共用方式為


IStatement.Execute Method

Definition

Overloads

Execute(String, String[])

Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

Execute(String, Int32[])

Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

Execute(String, Int32)

Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval.

Execute(String)

Executes the given SQL statement, which may return multiple results.

Execute(String, String[])

Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

[Android.Runtime.Register("execute", "(Ljava/lang/String;[Ljava/lang/String;)Z", "GetExecute_Ljava_lang_String_arrayLjava_lang_String_Handler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool Execute (string? sql, string[]? columnNames);
[<Android.Runtime.Register("execute", "(Ljava/lang/String;[Ljava/lang/String;)Z", "GetExecute_Ljava_lang_String_arrayLjava_lang_String_Handler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Execute : string * string[] -> bool

Parameters

sql
String

any SQL statement

columnNames
String[]

an array of the names of the columns in the inserted row that should be made available for retrieval by a call to the method getGeneratedKeys

Returns

true if the next result is a ResultSet object; false if it is an update count or there are no more results

Attributes

Exceptions

if an error occurs accessing the database.

Remarks

Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. This array contains the names of the columns in the target table that contain the auto-generated keys that should be made available. The driver will ignore the array if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.

The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).

<strong>Note:</strong>This method cannot be called on a PreparedStatement or CallableStatement.

Added in 1.4.

Java documentation for java.sql.Statement.execute(java.lang.String, java.lang.String[]).

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

Execute(String, Int32[])

Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.

[Android.Runtime.Register("execute", "(Ljava/lang/String;[I)Z", "GetExecute_Ljava_lang_String_arrayIHandler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool Execute (string? sql, int[]? columnIndexes);
[<Android.Runtime.Register("execute", "(Ljava/lang/String;[I)Z", "GetExecute_Ljava_lang_String_arrayIHandler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Execute : string * int[] -> bool

Parameters

sql
String

any SQL statement

columnIndexes
Int32[]

an array of the indexes of the columns in the inserted row that should be made available for retrieval by a call to the method getGeneratedKeys

Returns

true if the first result is a ResultSet object; false if it is an update count or there are no results

Attributes

Exceptions

if an error occurs accessing the database.

Remarks

Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. This array contains the indexes of the columns in the target table that contain the auto-generated keys that should be made available. The driver will ignore the array if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

Under some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.

The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).

<strong>Note:</strong>This method cannot be called on a PreparedStatement or CallableStatement.

Added in 1.4.

Java documentation for java.sql.Statement.execute(java.lang.String, 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

Execute(String, Int32)

Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval.

[Android.Runtime.Register("execute", "(Ljava/lang/String;I)Z", "GetExecute_Ljava_lang_String_IHandler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool Execute (string? sql, int autoGeneratedKeys);
[<Android.Runtime.Register("execute", "(Ljava/lang/String;I)Z", "GetExecute_Ljava_lang_String_IHandler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Execute : string * int -> bool

Parameters

sql
String

any SQL statement

autoGeneratedKeys
Int32

a constant indicating whether auto-generated keys should be made available for retrieval using the method getGeneratedKeys; one of the following constants: Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS

Returns

true if the first result is a ResultSet object; false if it is an update count or there are no results

Attributes

Exceptions

if an error occurs accessing the database.

Remarks

Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval. The driver will ignore this signal if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.

The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).

<strong>Note:</strong>This method cannot be called on a PreparedStatement or CallableStatement.

Added in 1.4.

Java documentation for java.sql.Statement.execute(java.lang.String, 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

Execute(String)

Executes the given SQL statement, which may return multiple results.

[Android.Runtime.Register("execute", "(Ljava/lang/String;)Z", "GetExecute_Ljava_lang_String_Handler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool Execute (string? sql);
[<Android.Runtime.Register("execute", "(Ljava/lang/String;)Z", "GetExecute_Ljava_lang_String_Handler:Java.Sql.IStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Execute : string -> bool

Parameters

sql
String

any SQL statement

Returns

true if the first result is a ResultSet object; false if it is an update count or there are no results

Attributes

Exceptions

if an error occurs accessing the database.

Remarks

Executes the given SQL statement, which may return multiple results. In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.

The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).

<strong>Note:</strong>This method cannot be called on a PreparedStatement or CallableStatement.

Java documentation for java.sql.Statement.execute(java.lang.String).

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