public abstract class AbstractInterruptibleBatchPreparedStatementSetter extends Object implements InterruptibleBatchPreparedStatementSetter
InterruptibleBatchPreparedStatementSetter
interface, combining the check for available values and setting of those
into a single callback method setValuesIfAvailable(java.sql.PreparedStatement, int).setValuesIfAvailable(java.sql.PreparedStatement, int)| Constructor and Description |
|---|
AbstractInterruptibleBatchPreparedStatementSetter() |
| Modifier and Type | Method and Description |
|---|---|
int |
getBatchSize()
This implementation returns
Integer.MAX_VALUE. |
boolean |
isBatchExhausted(int i)
This implementation return this instance's current exhaustion flag.
|
void |
setValues(PreparedStatement ps,
int i)
This implementation calls
setValuesIfAvailable(java.sql.PreparedStatement, int)
and sets this instance's exhaustion flag accordingly. |
protected abstract boolean |
setValuesIfAvailable(PreparedStatement ps,
int i)
Check for available values and set them on the given PreparedStatement.
|
public AbstractInterruptibleBatchPreparedStatementSetter()
public final void setValues(PreparedStatement ps, int i) throws SQLException
setValuesIfAvailable(java.sql.PreparedStatement, int)
and sets this instance's exhaustion flag accordingly.setValues in interface BatchPreparedStatementSetterps - the PreparedStatement to invoke setter methods oni - index of the statement we're issuing in the batch, starting from 0SQLException - if a SQLException is encountered
(i.e. there is no need to catch SQLException)public final boolean isBatchExhausted(int i)
isBatchExhausted in interface InterruptibleBatchPreparedStatementSetteri - index of the statement we're issuing in the batch, starting from 0BatchPreparedStatementSetter.setValues(java.sql.PreparedStatement, int),
setValuesIfAvailable(java.sql.PreparedStatement, int)public int getBatchSize()
Integer.MAX_VALUE.
Can be overridden in subclasses to lower the maximum batch size.getBatchSize in interface BatchPreparedStatementSetterprotected abstract boolean setValuesIfAvailable(PreparedStatement ps, int i) throws SQLException
false.ps - PreparedStatement we'll invoke setter methods oni - index of the statement we're issuing in the batch, starting from 0SQLException - if a SQLException is encountered
(i.e. there is no need to catch SQLException)