接口 SqlTypeValue
- 所有已知子接口:
DisposableSqlTypeValue
- 所有已知实现类:
AbstractSqlTypeValue
,SqlLobValue
public interface SqlTypeValue
Interface to be implemented for setting values for more complex database-specific types not supported by the standardsetObject
method. This is effectively an extended variant ofSqlValue
.Implementations perform the actual work of setting the actual values. They must implement the callback method
setTypeValue
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.- 从以下版本开始:
- 1.1
- 作者:
- Thomas Risberg, Juergen Hoeller
- 另请参阅:
Types
,PreparedStatement.setObject(int, java.lang.Object, int)
,JdbcOperations.update(String, Object[], int[])
,SqlValue
字段概要
字段 修饰符和类型 字段 说明 static int
TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
setTypeValue(PreparedStatement ps, int paramIndex, int sqlType, String typeName)
Set the type value on the given PreparedStatement.
字段详细资料
TYPE_UNKNOWN
static final int TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type. Passed intosetTypeValue
if the original operation method does not specify an SQL type.
方法详细资料
setTypeValue
void setTypeValue(PreparedStatement ps, int paramIndex, int sqlType, @Nullable String typeName) throws SQLException
Set the type value on the given PreparedStatement.- 参数:
ps
- the PreparedStatement to work 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)- 抛出:
SQLException
- if an SQLException is encountered while setting parameter values- 另请参阅:
Types
,PreparedStatement.setObject(int, java.lang.Object, int)