net.hasor.jdbc.core.value
接口 SqlTypeValue

所有已知子接口:
DisposableSqlTypeValue

public interface SqlTypeValue

Interface to be implemented for setting values for more complex database-specific types not supported by the standard setObject method. This is effectively an extended variant of SqlValue.

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)
          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 into setTypeValue if the original operation method does not specify a SQL type.

另请参见:
Types, JdbcOperations.update(String, Object[]), 常量字段值
方法详细信息

setTypeValue

void setTypeValue(PreparedStatement ps,
                  int paramIndex,
                  int sqlType)
                  throws SQLException
Set the type value on the given PreparedStatement.

参数:
ps - the PreparedStatement to work on
paramIndex - the index of the parameter for which we need to set the value
sqlType - SQL type of the parameter we are setting
typeName - the type name of the parameter (optional)
抛出:
SQLException - if a SQLException is encountered while setting parameter values
另请参见:
Types, PreparedStatement.setObject(int, java.lang.Object, int)


Copyright © 2013-2014. All Rights Reserved.