类 ArgumentPreparedStatementSetter
- java.lang.Object
- org.springframework.jdbc.core.ArgumentPreparedStatementSetter
- 所有已实现的接口:
ParameterDisposer
,PreparedStatementSetter
public class ArgumentPreparedStatementSetter extends Object implements PreparedStatementSetter, ParameterDisposer
Simple adapter forPreparedStatementSetter
that applies a given array of arguments.- 从以下版本开始:
- 3.2.3
- 作者:
- Juergen Hoeller
构造器概要
构造器 构造器 说明 ArgumentPreparedStatementSetter(Object[] args)
Create a new ArgPreparedStatementSetter for the given arguments.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
cleanupParameters()
Close the resources allocated by parameters that the implementing object holds, for example in case of a DisposableSqlTypeValue (like an SqlLobValue).protected void
doSetValue(PreparedStatement ps, int parameterPosition, Object argValue)
Set the value for prepared statements specified parameter index using the passed in value.void
setValues(PreparedStatement ps)
Set parameter values on the given PreparedStatement.
构造器详细资料
ArgumentPreparedStatementSetter
public ArgumentPreparedStatementSetter(@Nullable Object[] args)
Create a new ArgPreparedStatementSetter for the given arguments.- 参数:
args
- the arguments to set
方法详细资料
setValues
public void setValues(PreparedStatement ps) throws SQLException
从接口复制的说明:PreparedStatementSetter
Set parameter values on the given PreparedStatement.- 指定者:
setValues
在接口中PreparedStatementSetter
- 参数:
ps
- the PreparedStatement to invoke setter methods on- 抛出:
SQLException
- if an SQLException is encountered (i.e. there is no need to catch SQLException)
doSetValue
protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException
Set the value for prepared statements specified parameter index using the passed in value. This method can be overridden by sub-classes if needed.- 参数:
ps
- the PreparedStatementparameterPosition
- index of the parameter positionargValue
- the value to set- 抛出:
SQLException
- if thrown by PreparedStatement methods
cleanupParameters
public void cleanupParameters()
从接口复制的说明:ParameterDisposer
Close the resources allocated by parameters that the implementing object holds, for example in case of a DisposableSqlTypeValue (like an SqlLobValue).