public class ArgumentTypePreparedStatementSetter extends Object implements PreparedStatementSetter, ParameterDisposer
PreparedStatementSetter
that applies
given arrays of arguments and JDBC argument types.Constructor and Description |
---|
ArgumentTypePreparedStatementSetter(Object[] args,
int[] argTypes)
Create a new ArgTypePreparedStatementSetter for the given arguments.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public ArgumentTypePreparedStatementSetter(Object[] args, int[] argTypes)
args
- the arguments to setargTypes
- the corresponding SQL types of the argumentspublic void setValues(PreparedStatement ps) throws SQLException
PreparedStatementSetter
setValues
in interface PreparedStatementSetter
ps
- the PreparedStatement to invoke setter methods onSQLException
- if a SQLException is encountered
(i.e. there is no need to catch SQLException)protected void doSetValue(PreparedStatement ps, int parameterPosition, int argType, Object argValue) throws SQLException
ps
- the PreparedStatementparameterPosition
- index of the parameter positionargType
- the argument typeargValue
- the argument valueSQLException
public void cleanupParameters()
ParameterDisposer
cleanupParameters
in interface ParameterDisposer
DisposableSqlTypeValue.cleanup()
,
SqlLobValue.cleanup()