Top Description Fields Constructors Methods
org.springframework.jdbc.core

public Class ArgumentPreparedStatementSetter

extends Object
implements PreparedStatementSetter, ParameterDisposer
Class Inheritance
All Implemented Interfaces
org.springframework.jdbc.core.ParameterDisposer, org.springframework.jdbc.core.PreparedStatementSetter
Imports
java.sql.PreparedStatement, .SQLException, org.springframework.lang.Nullable

Simple adapter for PreparedStatementSetter that applies a given array of arguments.
Author
Juergen Hoeller
Since
3.2.3

Field Summary

Modifier and TypeField and Description
private final Object[]

Constructor Summary

AccessConstructor and Description
public
ArgumentPreparedStatementSetter(Object[]
the arguments to set
args
)

Create a new ArgumentPreparedStatementSetter for the given arguments.

Method Summary

Modifier and TypeMethod and Description
public void
cleanupParameters()

Implements org.springframework.jdbc.core.ParameterDisposer.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
the PreparedStatement
ps
,
int
index of the parameter position
parameterPosition
,
Object
the value to set
argValue
)

Set the value for the prepared statement's specified parameter position using the supplied value.

public void
setValues(PreparedStatement
the PreparedStatement to invoke setter methods on
ps
)

Implements org.springframework.jdbc.core.PreparedStatementSetter.setValues.

Set parameter values on the given PreparedStatement.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

argsback to summary
private final Object[] args
Annotations
@Nullable

Constructor Detail

ArgumentPreparedStatementSetterback to summary
public ArgumentPreparedStatementSetter(Object[] args)

Create a new ArgumentPreparedStatementSetter for the given arguments.

Parameters
args:Object[]

the arguments to set

Method Detail

cleanupParametersback to summary
public void cleanupParameters()

Implements org.springframework.jdbc.core.ParameterDisposer.cleanupParameters.

Doc from org.springframework.jdbc.core.ParameterDisposer.cleanupParameters.

Close the resources allocated by parameters that the implementing object holds, for example in case of a DisposableSqlTypeValue (like an SqlLobValue).

Annotations
@Override
doSetValueback to summary
protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException

Set the value for the prepared statement's specified parameter position using the supplied value.

This method can be overridden by subclasses if needed.

Parameters
ps:PreparedStatement

the PreparedStatement

parameterPosition:int

index of the parameter position

argValue:Object

the value to set

Exceptions
SQLException:
if thrown by PreparedStatement methods
setValuesback to summary
public void setValues(PreparedStatement ps) throws SQLException

Implements org.springframework.jdbc.core.PreparedStatementSetter.setValues.

Doc from org.springframework.jdbc.core.PreparedStatementSetter.setValues.

Set parameter values on the given PreparedStatement.

Parameters
ps:PreparedStatement

the PreparedStatement to invoke setter methods on

Annotations
@Override
Exceptions
SQLException:
if an SQLException is encountered (i.e. there is no need to catch SQLException)