You state that you are executing batches of SQL statements so I'm assuming that you are using
executeBatch. When you
executeBatch a batch of statements, some of the statements may succeed and some of the statements may fail. If one statement fails, that does not mean that the JDBC driver rolls back the statements that succeeded. The JDBC driver may choose to attempt to execute all the statements in the batch if one statement fails or it may choose to stop executing statements in the batch once a statement fails (it sounds like the driver you're using chooses to stop executing statements as soon as there is a failure).
When one statement in a batch fails, you should get a
BatchUpdateException. In your exception handler, you need to call
getUpdateCounts. That will give you an array of
int that tells you either how many rows the statement updated, a
Statement.SUCCESS_NO_INFO indicating the statement succeeded but no row count was available, or a
Statement.EXECUTE_FAILED indicating that the statement failed. If the first 99 statements succeed, the 100th statement generates an error, and the remaining statements are not executed, you should get back a 100 element array where the first 99 elements indicate success and the 100th element indicates
Statement.EXECUTE_FAILED. Your code would then need to retry those statements that were not executed (in this case, statements 101-1000).