Nonstop Database, HiRDB Version 9 UAP Development Guide
Several new JDBC SQL types have been added to JDBC2.0 basic standard. They are as follows:
Note that the JDBC driver can use only the ARRAY JDBC SQL type.
Tables 17-6 and 17-7 show the mapping between the getXXX methods and JDBC SQL types of ResultSet and CallableStatement.
If a getXXX method is called for an unsupported JDBC SQL type, the JDBC driver throws an SQLException. For details about the JDBC SQL types supported by the connected database, see 17.12 Data types and character codes.
Note that the getCharacterStream method has been added because the getUnicodeStream method is no longer recommended in the JDBC2.0 basic standard.
Table 17-6 Mapping between the getXXX methods and JDBC SQL types of ResultSet and CallableStatement (1/2)
getXXX method | JDBC SQL type | |||||
---|---|---|---|---|---|---|
SMALLINT | INTEGER | FLOAT | REAL | DECIMAL | CHAR | |
getByte | M | M | M | M | M | M#2 |
getShort | R | M | M | M | M | M#2 |
getInt | M | R | M | M | M | M#2 |
getLong | M | M | M | M | M | M#2 |
getFloat | M | M | M | R | M | M#2 |
getDouble | M | M | R | M | M | M#2 |
getBigDecimal | M | M | M | M | R | M#2 |
getBoolean | M | M | M | M | M | M |
getString | M | M | M | M | M | R |
getBytes | -- | -- | -- | -- | -- | -- |
getDate | -- | -- | -- | -- | -- | M#2 |
getTime | -- | -- | -- | -- | -- | M#2 |
getTimestamp | -- | -- | -- | -- | -- | M#2 |
getAsciiStream | -- | -- | -- | -- | -- | M |
getUnicodeStream | -- | -- | -- | -- | -- | M |
getBinaryStream | -- | -- | -- | -- | -- | -- |
getObject | M | M | M | M | M | M |
getCharacterStream | -- | -- | -- | -- | -- | M |
getArray | -- | -- | -- | -- | -- | -- |
getBlob | -- | -- | -- | -- | -- | -- |
getClob#1 | -- | -- | -- | -- | -- | -- |
getRef#1 | -- | -- | -- | -- | -- | -- |
Table 17-7 Mapping between the getXXX methods and JDBC SQL types of ResultSet and CallableStatement (2/2)
getXXX method | JDBC SQL type | |||||
---|---|---|---|---|---|---|
VARCHAR | DATE | TIME | TIMESTAMP | LONGVARBINARY | ARRAY | |
getByte | M#2 | -- | -- | -- | -- | -- |
getShort | M#2 | -- | -- | -- | -- | -- |
getInt | M#2 | -- | -- | -- | -- | -- |
getLong | M#2 | -- | -- | -- | -- | -- |
getFloat | M#2 | -- | -- | -- | -- | -- |
getDouble | M#2 | -- | -- | -- | -- | -- |
getBigDecimal | M#2 | -- | -- | -- | -- | -- |
getBoolean | M#2 | -- | -- | -- | -- | -- |
getString | R | M | M | M | M | -- |
getBytes | -- | -- | -- | -- | M | -- |
getDate | M#2 | R#3 | -- | M | -- | -- |
getTime | M#2 | -- | R | M | -- | -- |
getTimestamp | M#2 | M | -- | R | -- | -- |
getAsciiStream | M | -- | -- | -- | M | -- |
getUnicodeStream | M | -- | -- | -- | M | -- |
getBinaryStream | -- | -- | -- | -- | R | -- |
getObject | M | M | M | M | M | M |
getCharacterStream | M | -- | -- | -- | M | -- |
getArray | -- | -- | -- | -- | -- | R |
getBlob | -- | -- | -- | -- | M | -- |
getClob#1 | -- | -- | -- | -- | -- | -- |
getRef#1 | -- | -- | -- | -- | -- | -- |
The table below shows the setXXX methods of the PreparedStatement and CallableStatement classes and the JDBC SQL types to be mapped. For an unsupported JDBC SQL type, the setXXX method throws an SQLException. For details about the JDBC SQL types supported by the connected database, see 17.12 Data types and character codes.
Note that the setCharacterStream method has been added because the setUnicodeStream method is no longer recommended in the JDBC2.0 basic standard.
Table 17-8 setXXX methods and JDBC SQL types to be mapped for PreparedStatement class
PreparedStatement class's setXXX method | JDBC SQL type to be mapped |
---|---|
setCharacterStream | CHAR, VARCHAR, or LONGVARCHAR |
SetRef# | REF |
setBlob | LONGVARBINARY |
setClob# | CLOB |
setArray | ARRAY |
Tables 17-9 and 17-10 show the mapping between the setXXX methods and JDBC SQL types of PreparedStatement and CallableStatement.
Table 17-9 Mapping between the setXXX methods and JDBC SQL types of PreparedStatement and CallableStatement (1/2)
setXXX method | JDBC SQL type | |||||
---|---|---|---|---|---|---|
SMALLINT | INTEGER | FLOAT | REAL | DECIMAL | CHAR | |
setByte | M | M | M | M | M | M |
setShort | R | M | M | M | M | M |
setInt | M | R | M | M | M | M |
setLong | M | M | M | M | M | M |
setFloat | M | M | M | R | M | M |
setDouble | M | M | R | M | M | M |
setBigDecimal | M | M | M | M | R | M |
setBoolean | M | M | M | M | M | M |
setString | M | M | M | M | M | R |
setBytes | -- | -- | -- | -- | -- | -- |
setDate | -- | -- | -- | -- | -- | M |
setTime | -- | -- | -- | -- | -- | M |
setTimestamp | -- | -- | -- | -- | -- | M |
setAsciiStream | -- | -- | -- | -- | -- | M |
setUnicodeStream | -- | -- | -- | -- | -- | M |
setBinaryStream | -- | -- | -- | -- | -- | -- |
setObject | M | M | M | M | M | M |
setCharacterStream | -- | -- | -- | -- | -- | M |
setArray | -- | -- | -- | -- | -- | -- |
setBlob | -- | -- | -- | -- | -- | -- |
setClob# | -- | -- | -- | -- | -- | -- |
setRef# | -- | -- | -- | -- | -- | -- |
Table 17-10 Mapping between the setXXX methods and JDBC SQL types of PreparedStatement and CallableStatement (2/2)
setXXX method | JDBC SQL type | |||||
---|---|---|---|---|---|---|
VARCHAR | DATE | TIME | TIMESTAMP | LONGVARBINARY | ARRAY | |
setByte | M | -- | -- | -- | -- | -- |
setShort | M | -- | -- | -- | -- | -- |
setInt | M | -- | -- | -- | -- | -- |
setLong | M | -- | -- | -- | -- | -- |
setFloat | M | -- | -- | -- | -- | -- |
setDouble | M | -- | -- | -- | -- | -- |
setBigDecimal | M | -- | -- | -- | -- | -- |
setBoolean | M | -- | -- | -- | -- | -- |
setString | R | M | M | M | M | -- |
setBytes | -- | -- | -- | -- | M | -- |
setDate | M | R#2 | -- | M | -- | -- |
setTime | M | -- | R | M | -- | -- |
setTimestamp | M | M | -- | R | -- | -- |
setAsciiStream | M | -- | -- | -- | M | -- |
setUnicodeStream | M | -- | -- | -- | M | -- |
setBinaryStream | -- | -- | -- | -- | R | -- |
setObject | M | M | M | M | M | M |
setCharacterStream | M | -- | -- | -- | M | -- |
setArray | -- | -- | -- | -- | -- | R |
setBlob | -- | -- | -- | -- | M | -- |
setClob#1 | -- | -- | -- | -- | -- | -- |
setRef#1 | -- | -- | -- | -- | -- | -- |
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.