|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InterruptibleBatchPreparedStatementSetter
Extension of the BatchPreparedStatementSetter interface that adds 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.
The isBatchExhausted
method is called after each call to
setValues
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 setValues
.
Consider extending the AbstractInterruptibleBatchPreparedStatementSetter base class instead of implementing this interface directly, having a single callback method that combines the check for available values and the setting of those.
JdbcTemplate.batchUpdate(String, BatchPreparedStatementSetter)
,
AbstractInterruptibleBatchPreparedStatementSetter
Method Summary | |
---|---|
boolean |
isBatchExhausted(int i)
Return whether the batch is complete, that is, whether there were no additional values added during the last setValues call. |
Methods inherited from interface org.springframework.jdbc.core.BatchPreparedStatementSetter |
---|
getBatchSize, setValues |
Method Detail |
---|
boolean isBatchExhausted(int i)
setValues
call.
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 setValues
implementation, letting this method return true
based on the flag.
i
- index of the statement we're issuing in the batch, starting from 0BatchPreparedStatementSetter.setValues(java.sql.PreparedStatement, int)
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |