Connection.createStatement Method

Creates a Statement object that is used to execute an SQL statement.

Syntax

public Statement createStatement([ResultSetType resultSetType, ResultSetConcurrency resultSetConcurrency])

Run On

Server

Parameters

Return Value

Type: Statement Class
A data type value that is a new Statement object.

Remarks

There is risk of an SQL injection threat when you use the createStatement method to create an SQL statement and then allow a user to control input to the statement. For information about SQL injection, see https://go.microsoft.com/fwlink/?LinkId=114986.

You can use Query Elements in the AOT, views, and X++ Select statements as safer alternatives to executing SQL statements.

See Also

Reference

Connection Class