public class ArgumentTypePreparedStatementSetter extends java.lang.Object implements PreparedStatementSetter, ParameterDisposer
PreparedStatementSetter that applies
given arrays of arguments and JDBC argument types.| Constructor and Description |
|---|
ArgumentTypePreparedStatementSetter(java.lang.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(java.sql.PreparedStatement ps,
int parameterPosition,
int argType,
java.lang.Object argValue)
Set the value for the prepared statement's specified parameter position using the passed in
value and type.
|
void |
setValues(java.sql.PreparedStatement ps)
Set parameter values on the given PreparedStatement.
|
public ArgumentTypePreparedStatementSetter(java.lang.Object[] args,
int[] argTypes)
args - the arguments to setargTypes - the corresponding SQL types of the argumentspublic void setValues(java.sql.PreparedStatement ps)
throws java.sql.SQLException
PreparedStatementSettersetValues in interface PreparedStatementSetterps - the PreparedStatement to invoke setter methods onjava.sql.SQLException - if a SQLException is encountered
(i.e. there is no need to catch SQLException)protected void doSetValue(java.sql.PreparedStatement ps,
int parameterPosition,
int argType,
java.lang.Object argValue)
throws java.sql.SQLException
ps - the PreparedStatementparameterPosition - index of the parameter positionargType - the argument typeargValue - the argument valuejava.sql.SQLException - if thrown by PreparedStatement methodspublic void cleanupParameters()
ParameterDisposercleanupParameters in interface ParameterDisposerDisposableSqlTypeValue.cleanup(),
SqlLobValue.cleanup()