public class ResultSets extends Object
| 构造器和说明 |
|---|
ResultSets() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
getResultSetValue(ResultSet rs,
int index)
Retrieve a JDBC column value from a ResultSet, using the most appropriate
value type.
|
static Object |
getResultSetValue(ResultSet rs,
int index,
Class<?> requiredType)
Retrieve a JDBC column value from a ResultSet, using the specified value type.
|
@Nullable public static Object getResultSetValue(ResultSet rs, int index, @Nullable Class<?> requiredType) throws SQLException
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 dataindex - is the column indexrequiredType - the required value type (may be null)SQLException - if thrown by the JDBC APIgetResultSetValue(ResultSet, int)@Nullable public static Object getResultSetValue(ResultSet rs, int index) throws SQLException
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 dataindex - is the column indexSQLException - if thrown by the JDBC APIBlob,
Clob,
TimestampCopyright © 2021. All rights reserved.