类 ArgumentTypePreparedStatementSetter
- java.lang.Object
- org.springframework.jdbc.core.ArgumentTypePreparedStatementSetter
- 所有已实现的接口:
ParameterDisposer
,PreparedStatementSetter
public class ArgumentTypePreparedStatementSetter extends Object implements PreparedStatementSetter, ParameterDisposer
Simple adapter forPreparedStatementSetter
that applies given arrays of arguments and JDBC argument types.- 从以下版本开始:
- 3.2.3
- 作者:
- Juergen Hoeller
构造器概要
构造器 构造器 说明 ArgumentTypePreparedStatementSetter(Object[] args, int[] argTypes)
Create a new ArgTypePreparedStatementSetter 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 a SqlLobValue).protected void
doSetValue(PreparedStatement ps, int parameterPosition, int argType, Object argValue)
Set the value for the prepared statement's specified parameter position using the passed in value and type.void
setValues(PreparedStatement ps)
Set parameter values on the given PreparedStatement.
构造器详细资料
ArgumentTypePreparedStatementSetter
public ArgumentTypePreparedStatementSetter(Object[] args, int[] argTypes)
Create a new ArgTypePreparedStatementSetter for the given arguments.- 参数:
args
- the arguments to setargTypes
- the corresponding SQL types of the arguments
方法详细资料
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 a SQLException is encountered (i.e. there is no need to catch SQLException)
doSetValue
protected void doSetValue(PreparedStatement ps, int parameterPosition, int argType, Object argValue) throws SQLException
Set the value for the prepared statement's specified parameter position using the passed in value and type. This method can be overridden by sub-classes if needed.- 参数:
ps
- the PreparedStatementparameterPosition
- index of the parameter positionargType
- the argument typeargValue
- the argument value- 抛出:
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 a SqlLobValue).