Class BatchUpdateException

public class BatchUpdateException extends SQLException

A BatchUpdateException is a SQLException that is thrown when an error occurs during a batch update. An update count that represents the number of successful updates per batch element is provided. You can set the update count to EXECUTE_FAILED in case the update failed; the driver may or may not continue to process the batch update elements. Updates are performed in the same order that they were added to the batch update.

Constructors

BatchUpdateException

public BatchUpdateException(String reason, String SQLState, int vendorCode, int[] updateCounts)

This builds a BatchUpdateException object.

Parameters:

reason:

The exception message

SQLState:

The X/OPEN code identifying the error

vendorCode:

The database vendor specific exception

updateCounts:

An array of update counts for each element of this batch

BatchUpdateException

public BatchUpdateException(String reason, String SQLState, int[] updateCounts)

This builds a BatchUpdateException object with a 0 vendor error code.

Parameters:

reason:

The exception message

SQLState:

The X/OPEN code identifying the error

updateCounts:

An array of update counts for each element of this batch

BatchUpdateException

public BatchUpdateException(String reason, int[] updateCounts)

This builds a BatchUpdateException object with a 0 vendor error code and SQLState.

Parameters:

reason:

The exception message

updateCounts:

An array of update counts for each element of this batch

BatchUpdateException

public BatchUpdateException(int[] updateCounts)

This builds a BatchUpdateException object with a 0 vendor error code and SQLState and a null exception reason message.

Parameters:

updateCounts:

An array of update counts for each element of this batch

BatchUpdateException

public BatchUpdateException()

This builds a BatchUpdateException object with a 0 vendor error code and SQLState and a null exception reason message and update count array.

Methods

getUpdateCounts

public int[] getUpdateCounts()

The array returned by this method contains the update counts for this batch. When this exception is thrown, a failure occurs, and the current count is set to EXECUTE_FAILED. The driver may or may not continue processing the other update statements in the batch.

Returns: An array of int containing the update counts for the updates that were executed successfully before this exception was thrown. The elements of the array can be as follows:

  • The update count

  • SUCESS_NO_INFO if the number of rows affected by the update isn’t known and no error occurred

  • EXECUTE_FAILED if an error occurred



JDBC 3. 0. JAVA Database Connectivity
JDBC 3: Java Database Connectivity
ISBN: 0764548751
EAN: 2147483647
Year: 2002
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net