Top Description Methods
org.springframework.jdbc.support

public Interface SqlValue

Known Direct Subinterfaces
org.springframework.jdbc.support.xml.SqlXmlValue
Known Direct Implementers
org.springframework.jdbc.support.SqlArrayValue
Imports
java.sql.PreparedStatement, .SQLException

Simple interface for complex types to be set as statement parameters.

Implementations perform the actual work of setting the actual values. They must implement the callback method setValue which can throw SQLExceptions that will be caught and translated by the calling code. This callback method has access to the underlying Connection via the given PreparedStatement object, if that should be needed to create any database-specific objects.

Author
Juergen Hoeller
Since
2.5.6
See Also
org.springframework.jdbc.core.SqlTypeValue, org.springframework.jdbc.core.DisposableSqlTypeValue

Method Summary

Modifier and TypeMethod and Description
public void
cleanup()

Clean up resources held by this value object.

public void
setValue(PreparedStatement
the PreparedStatement to work on
ps
,
int
the index of the parameter for which we need to set the value
paramIndex
)

Set the value on the given PreparedStatement.

Method Detail

cleanupback to summary
public void cleanup()

Clean up resources held by this value object.

setValueback to summary
public void setValue(PreparedStatement ps, int paramIndex) throws SQLException

Set the value on the given PreparedStatement.

Parameters
ps:PreparedStatement

the PreparedStatement to work on

paramIndex:int

the index of the parameter for which we need to set the value

Exceptions
SQLException:
if an SQLException is encountered while setting parameter values