9.2.3 Batch update functionality with the PreparedStatement class
The following notes apply to the batch update functionality with the PreparedStatement class.
-
Use the normal procedure (setXXX method) to specify dynamic parameters for SQL statements specified when a PreparedStatement instance was created.
-
Use the addBatch method to register the dynamic parameter sets.
-
Use the executeBatch method or the executeLargeBatch method to execute the multiple registered dynamic parameter sets as a batch.
-
An array of the numbers of rows updated by the individual dynamic parameter sets is returned as the batch execution results.
-
If an error occurs during batch execution, the batch update functionality throws a BatchUpdateException.