Nonstop Database, HiRDB Version 9 UAP Development Guide
The tables below show the mapping between getXXX methods of the ResultSet and CallableStatement classes and JDBC's SQL data types. If a getXXX method is called for one of JDBC's unmappable SQL data types, the JDBC driver throws an SQLException.
Table 18-66 Mapping between getXXX methods and JDBC's SQL data types (1/2)
getXXX method | JDBC's SQL data type | |||||
---|---|---|---|---|---|---|
SMALLINT | INTEGER | FLOAT | REAL | DECIMAL | CHAR | |
getByte | Y | Y | Y | Y | Y | Y#1 |
getShort | Rec. | Y | Y | Y | Y | Y#1 |
getInt | Y | Rec. | Y | Y | Y | Y#1 |
getLong | Y | Y | Y | Y | Y | Y#1 |
getFloat | Y | Y | Y | Rec. | Y | Y#1 |
getDouble | Y | Y | Rec. | Y | Y | Y#1 |
getBigDecimal | Y | Y | Y | Y | Rec. | Y#1 |
getBoolean | Y | Y | Y | Y | Y | Y |
getString | Y | Y | Y | Y | Y | Rec. |
getBytes | -- | -- | -- | -- | -- | -- |
getDate | -- | -- | -- | -- | -- | Y#1 |
getTime | -- | -- | -- | -- | -- | Y#1 |
getTimestamp | -- | -- | -- | -- | -- | Y#1 |
getAsciiStream | -- | -- | -- | -- | -- | Y |
getBinaryStream | -- | -- | -- | -- | -- | -- |
getObject | Y | Y | Y | Y | Y | Y |
getCharacterStream | -- | -- | -- | -- | -- | Y |
getArray | -- | -- | -- | -- | -- | -- |
getBlob | -- | -- | -- | -- | -- | -- |
Table 18-67 Mapping between getXXX methods and JDBC's SQL data types (2/2)
getXXX method | JDBC's SQL data type | |||||
---|---|---|---|---|---|---|
VARCHAR | DATE | TIME | TIMESTAMP | LONGVARBINARY | ARRAY | |
getByte | Y#1 | -- | -- | -- | -- | -- |
getShort | Y#1 | -- | -- | -- | -- | -- |
getInt | Y#1 | -- | -- | -- | -- | -- |
getLong | Y#1 | -- | -- | -- | -- | -- |
getFloat | Y#1 | -- | -- | -- | -- | -- |
getDouble | Y#1 | -- | -- | -- | -- | -- |
getBigDecimal | Y#1 | -- | -- | -- | -- | -- |
getBoolean | Y | -- | -- | -- | -- | -- |
getString | Rec. | Y | Y | Y | Y | -- |
getBytes | -- | -- | -- | -- | Y | -- |
getDate | Y#1 | Rec.#2 | -- | Y | -- | -- |
getTime | Y#1 | -- | Rec. | Y | -- | -- |
getTimestamp | Y#1 | Y | -- | Rec. | -- | -- |
getAsciiStream | Y | -- | -- | -- | Y | -- |
getBinaryStream | -- | -- | -- | -- | Rec. | -- |
getObject | Y | Y | Y | Y | Y | -- |
getCharacterStream | Y | -- | -- | -- | Y | -- |
getArray | -- | -- | -- | -- | -- | Rec. |
getBlob | -- | -- | -- | -- | Y | -- |
#1
If there are any single-byte spaces preceding or following the character string data retrieved from the database during conversion by this method, the JDBC driver removes them. After removing the single-byte spaces, the JDBC driver converts the data to the Java data type returned by the getXXX method.
Note the following items when data is converted to a Java data type:
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.