共用方式為


BatchUpdateException.GetUpdateCounts Method

Definition

Retrieves the update count for each update statement in the batch update that executed successfully before this exception occurred.

[Android.Runtime.Register("getUpdateCounts", "()[I", "GetGetUpdateCountsHandler")]
public virtual int[]? GetUpdateCounts ();
[<Android.Runtime.Register("getUpdateCounts", "()[I", "GetGetUpdateCountsHandler")>]
abstract member GetUpdateCounts : unit -> int[]
override this.GetUpdateCounts : unit -> int[]

Returns

Int32[]

an array of int containing the update counts for the updates that were executed successfully before this error occurred. Or, if the driver continues to process commands after an error, one of the following for every command in the batch: <OL> <LI>an update count <LI>Statement.SUCCESS_NO_INFO to indicate that the command executed successfully but the number of rows affected is unknown <LI>Statement.EXECUTE_FAILED to indicate that the command failed to execute successfully </OL>

Attributes

Remarks

Retrieves the update count for each update statement in the batch update that executed successfully before this exception occurred. A driver that implements batch updates may or may not continue to process the remaining commands in a batch when one of the commands fails to execute properly. If the driver continues processing commands, the array returned by this method will have as many elements as there are commands in the batch; otherwise, it will contain an update count for each command that executed successfully before the BatchUpdateException was thrown.

The possible return values for this method were modified for the Java 2 SDK, Standard Edition, version 1.3. This was done to accommodate the new option of continuing to process commands in a batch update after a BatchUpdateException object has been thrown.

Added in 1.3.

Java documentation for java.sql.BatchUpdateException.getUpdateCounts().

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