|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter
public abstract class AbstractInterruptibleBatchPreparedStatementSetter
Abstract implementation of the InterruptibleBatchPreparedStatementSetter
interface, combining the check for available values and setting of those
into a single callback method (setValuesIfAvailable
).
setValuesIfAvailable(java.sql.PreparedStatement, int)
Constructor Summary | |
---|---|
AbstractInterruptibleBatchPreparedStatementSetter()
|
Method Summary | |
---|---|
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 setValuesAndCheck
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractInterruptibleBatchPreparedStatementSetter()
Method Detail |
---|
public final void setValues(PreparedStatement ps, int i) throws SQLException
setValuesAndCheck
and sets this instance's exhaustion flag accordingly.
setValues
in interface BatchPreparedStatementSetter
ps
- PreparedStatement we'll invoke setter methods oni
- index of the statement we're issuing in the batch, starting from 0
SQLException
- there is no need to catch SQLExceptions
that may be thrown in the implementation of this method.
The JdbcTemplate class will handle them.public final boolean isBatchExhausted(int i)
isBatchExhausted
in interface InterruptibleBatchPreparedStatementSetter
i
- index of the statement we're issuing in the batch, starting from 0BatchPreparedStatementSetter.setValues(java.sql.PreparedStatement, int)
public int getBatchSize()
Integer.MAX_VALUE
.
Can be overridden in subclasses to lower the maximum batch size.
getBatchSize
in interface BatchPreparedStatementSetter
protected 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 0
SQLException
- if thrown by JDBC API methods
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |