类 AbstractInterruptibleBatchPreparedStatementSetter
- java.lang.Object
- org.springframework.jdbc.core.support.AbstractInterruptibleBatchPreparedStatementSetter
public abstract class AbstractInterruptibleBatchPreparedStatementSetter extends Object implements InterruptibleBatchPreparedStatementSetter
Abstract implementation of theInterruptibleBatchPreparedStatementSetter
interface, combining the check for available values and setting of those into a single callback methodsetValuesIfAvailable(java.sql.PreparedStatement, int)
.- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller
- 另请参阅:
setValuesIfAvailable(java.sql.PreparedStatement, int)
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 int
getBatchSize()
This implementation returnsInteger.MAX_VALUE
.boolean
isBatchExhausted(int i)
This implementation return this instance's current exhaustion flag.void
setValues(PreparedStatement ps, int i)
This implementation callssetValuesIfAvailable(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.
构造器详细资料
AbstractInterruptibleBatchPreparedStatementSetter
public AbstractInterruptibleBatchPreparedStatementSetter()
方法详细资料
setValues
public final void setValues(PreparedStatement ps, int i) throws SQLException
This implementation callssetValuesIfAvailable(java.sql.PreparedStatement, int)
and sets this instance's exhaustion flag accordingly.- 指定者:
setValues
在接口中BatchPreparedStatementSetter
- 参数:
ps
- the PreparedStatement to invoke setter methods oni
- index of the statement we're issuing in the batch, starting from 0- 抛出:
SQLException
- if an SQLException is encountered (i.e. there is no need to catch SQLException)
isBatchExhausted
public final boolean isBatchExhausted(int i)
This implementation return this instance's current exhaustion flag.- 指定者:
isBatchExhausted
在接口中InterruptibleBatchPreparedStatementSetter
- 参数:
i
- index of the statement we're issuing in the batch, starting from 0- 返回:
- whether the batch is already exhausted
- 另请参阅:
BatchPreparedStatementSetter.setValues(java.sql.PreparedStatement, int)
,setValuesIfAvailable(java.sql.PreparedStatement, int)
getBatchSize
public int getBatchSize()
This implementation returnsInteger.MAX_VALUE
. Can be overridden in subclasses to lower the maximum batch size.- 指定者:
getBatchSize
在接口中BatchPreparedStatementSetter
- 返回:
- the number of statements in the batch
setValuesIfAvailable
protected abstract boolean setValuesIfAvailable(PreparedStatement ps, int i) throws SQLException
Check for available values and set them on the given PreparedStatement. If no values are available anymore, returnfalse
.- 参数:
ps
- the PreparedStatement we'll invoke setter methods oni
- index of the statement we're issuing in the batch, starting from 0- 返回:
- whether there were values to apply (that is, whether the applied parameters should be added to the batch and this method should be called for a further iteration)
- 抛出:
SQLException
- if an SQLException is encountered (i.e. there is no need to catch SQLException)