public interface InterruptibleBatchPreparedStatementSetter extends BatchPreparedStatementSetter
BatchPreparedStatementSetterinterface, adding a batch exhaustion check.
This interface allows you to signal the end of a batch rather than having to determine the exact batch size upfront. Batch size is still being honored but it is now the maximum size of the batch.
isBatchExhausted(int) method is called after each call to
BatchPreparedStatementSetter.setValues(java.sql.PreparedStatement, int) to determine whether there were some values added,
or if the batch was determined to be complete and no additional values
were provided during the last call to
Consider extending the
base class instead of implementing this interface directly, using a single
setValuesIfAvailable callback method that checks for available
values and sets them, returning whether values have actually been provided.
|Modifier and Type||Method and Description|
Return whether the batch is complete, that is, whether there were no additional values added during the last
boolean isBatchExhausted(int i)
NOTE: If this method returns
true, any parameters
that might have been set during the last
setValues call will
be ignored! Make sure that you set a corresponding internal flag if you
detect exhaustion at the beginning of your
implementation, letting this method return
true based on the flag.
i- index of the statement we're issuing in the batch, starting from 0