Submits a batch of SQL commands to the database. Returns an array of update counts, if all the commands execute successfully.
If one of the commands in the batch fails, this method can throw a BatchUpdateException and the JDBC driver may or may not process the remaining commands. The JDBC driver must behave consistently with the underlying database, either always continuing or never continuing. If the driver continues processing, the array of results returned contains the same number of elements as there are commands in the batch, with a minimum of one of the elements having the EXECUTE_FAILED value.
@return an array of update counts, with one entry for each command in thebatch. The elements are ordered according to the order in which the commands were added to the batch.
- If the value of an element is >=0, the corresponding command completed successfully and the value is the update count for that command, which is the number of rows in the database affected by the command.
- If the value is SUCCESS_NO_INFO, the command completed successfully but the number of rows affected is unknown.
-
- If the value is EXECUTE_FAILED, the command failed.
@throws SQLException if an error occurs accessing the database