IConnection.CreateStatement Method

Definition

Overloads

CreateStatement()

Creates a Statement object for sending SQL statements to the database.

CreateStatement(Int32, Int32)

Creates a Statement object that will generate ResultSet objects with the given type and concurrency.

CreateStatement(Int32, Int32, Int32)

Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.

CreateStatement()

Creates a Statement object for sending SQL statements to the database.

[Android.Runtime.Register("createStatement", "()Ljava/sql/Statement;", "GetCreateStatementHandler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Sql.IStatement? CreateStatement ();
[<Android.Runtime.Register("createStatement", "()Ljava/sql/Statement;", "GetCreateStatementHandler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member CreateStatement : unit -> Java.Sql.IStatement

Returns

a new default Statement object

Attributes

Exceptions

if there is a problem accessing the database.

Remarks

Creates a Statement object for sending SQL statements to the database. SQL statements without parameters are normally executed using Statement objects. If the same SQL statement is executed many times, it may be more efficient to use a PreparedStatement object.

Result sets created using the returned Statement object will by default be type TYPE_FORWARD_ONLY and have a concurrency level of CONCUR_READ_ONLY. The holdability of the created result sets can be determined by calling #getHoldability.

Java documentation for java.sql.Connection.createStatement().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

CreateStatement(Int32, Int32)

Creates a Statement object that will generate ResultSet objects with the given type and concurrency.

[Android.Runtime.Register("createStatement", "(II)Ljava/sql/Statement;", "GetCreateStatement_IIHandler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Sql.IStatement? CreateStatement (int resultSetType, int resultSetConcurrency);
[<Android.Runtime.Register("createStatement", "(II)Ljava/sql/Statement;", "GetCreateStatement_IIHandler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member CreateStatement : int * int -> Java.Sql.IStatement

Parameters

resultSetType
Int32

a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE

resultSetConcurrency
Int32

a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE

Returns

a new Statement object that will generate ResultSet objects with the given type and concurrency

Attributes

Exceptions

if there is a problem accessing the database

Remarks

Creates a Statement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the createStatement method above, but it allows the default result set type and concurrency to be overridden. The holdability of the created result sets can be determined by calling #getHoldability.

Added in 1.2.

Java documentation for java.sql.Connection.createStatement(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

CreateStatement(Int32, Int32, Int32)

Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.

[Android.Runtime.Register("createStatement", "(III)Ljava/sql/Statement;", "GetCreateStatement_IIIHandler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Sql.IStatement? CreateStatement (int resultSetType, int resultSetConcurrency, int resultSetHoldability);
[<Android.Runtime.Register("createStatement", "(III)Ljava/sql/Statement;", "GetCreateStatement_IIIHandler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member CreateStatement : int * int * int -> Java.Sql.IStatement

Parameters

resultSetType
Int32

one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE

resultSetConcurrency
Int32

one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE

resultSetHoldability
Int32

one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT

Returns

a new Statement object that will generate ResultSet objects with the given type, concurrency, and holdability

Attributes

Exceptions

if there is a problem accessing the database.

Remarks

Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability. This method is the same as the createStatement method above, but it allows the default result set type, concurrency, and holdability to be overridden.

Added in 1.4.

Java documentation for java.sql.Connection.createStatement(int, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to