@Nullable open static fun getResultSetValue(rs: ResultSet, index: Int, @Nullable requiredType: Class<*>): Any
Retrieve a JDBC column value from a ResultSet, using the specified value type.
Uses the specifically typed ResultSet accessor methods, falling back to #getResultSetValue(java.sql.ResultSet, int) for unknown types.
Note that the returned value may not be assignable to the specified required type, in case of an unknown type. Calling code needs to deal with this case appropriately, e.g. throwing a corresponding exception.
rs - is the ResultSet holding the data
requiredType - the required value type (may be null)
SQLException - if thrown by the JDBC API
Return
the value object (possibly not of the specified required type, with further conversion steps necessary)
See Also
#getResultSetValue(ResultSet, int)
@Nullable open static fun getResultSetValue(rs: ResultSet, index: Int): Any
Retrieve a JDBC column value from a ResultSet, using the most appropriate value type. The returned value should be a detached value object, not having any ties to the active ResultSet: in particular, it should not be a Blob or Clob object but rather a byte array or String representation, respectively.
Uses the getObject(index) method, but includes additional "hacks" to get around Oracle 10g returning a non-standard object for its TIMESTAMP datatype and a java.sql.Date for DATE columns leaving out the time portion: These columns will explicitly be extracted as standard java.sql.Timestamp object.
rs - is the ResultSet holding the data
SQLException - if thrown by the JDBC API
Return
the value object
See Also
java.sql.Blobjava.sql.Clobjava.sql.Timestamp