Package org.springframework.jdbc.core
Interface SqlReturnType
public interface SqlReturnType
Interface to be implemented for retrieving values for more complex database-specific
types not supported by the standard
CallableStatement.getObject
method.
Implementations perform the actual work of getting the actual values. They must
implement the callback method getTypeValue
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 CallableStatement object, if that
should be needed to create any database-specific objects.
- Since:
- 1.1
- Author:
- Thomas Risberg
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant that indicates an unknown (or unspecified) SQL type. -
Method Summary
Modifier and TypeMethodDescriptiongetTypeValue
(CallableStatement cs, int paramIndex, int sqlType, String typeName) Get the type value from the specific object.
-
Field Details
-
TYPE_UNKNOWN
static final int TYPE_UNKNOWNConstant that indicates an unknown (or unspecified) SQL type. Passed into setTypeValue if the original operation method does not specify an SQL type.
-
-
Method Details
-
getTypeValue
Object getTypeValue(CallableStatement cs, int paramIndex, int sqlType, @Nullable String typeName) throws SQLException Get the type value from the specific object.- Parameters:
cs
- the CallableStatement to operate onparamIndex
- the index of the parameter for which we need to set the valuesqlType
- the SQL type of the parameter we are settingtypeName
- the type name of the parameter (optional)- Returns:
- the target value
- Throws:
SQLException
- if an SQLException is encountered setting parameter values (that is, there's no need to catch SQLException)- See Also:
-