Interface InterruptibleBatchPreparedStatementSetter

All Superinterfaces:
BatchPreparedStatementSetter
All Known Implementing Classes:
AbstractInterruptibleBatchPreparedStatementSetter

public interface InterruptibleBatchPreparedStatementSetter extends BatchPreparedStatementSetter
Extension of the BatchPreparedStatementSetter interface, 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.

The 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 setValues.

Consider extending the AbstractInterruptibleBatchPreparedStatementSetter 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.

Since:
2.0
Author:
Thomas Risberg, Juergen Hoeller
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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