Nonstop Database, HiRDB Version 9 UAP Development Guide

[Contents][Index][Back][Next]

19.3.4 Correspondence between HiRDB data types and SQLJ data types

The table below shows the correspondence between the HiRDB data types and the SQLJ data types. To use embedded variables in SQLJ, declare variables according to this table.

Table 19-4 Correspondence between HiRDB data types and SQLJ data types

HiRDB data types SQLJ data types (Java data types)
When a null value is included When a null value is not included
CHAR#1 java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBCHAR#4 N/A
VARCHAR java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBVARCHAR#4 N/A
NCHAR#1 java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBNCHAR#4 N/A
NVARCHAR#1 java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBNVARCHAR#4 N/A
MCHAR#1 java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBMCHAR#4 N/A
MVARCHAR#1 java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBMVARCHAR#4 N/A
DECIMAL#2 java.math.BigDecimal N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBDECIMAL#4 N/A
SMALLINT java.lang.Short short
INTEGER java.lang.Integer int
REAL, SMALLFLT java.lang.Float float
FLOAT, DOUBLE PRECISION java.lang.Double double
DATE java.sql.Date N/A
TIME java.sql.Time N/A
TIMESTAMP java.sql.Timestamp N/A
INTERVAL HOUR TO SECOND N/A N/A
INTERVAL YEAR TO DAY N/A N/A
BLOB#3 JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBBLOB#4 byte[]
BINARY JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBBINARY#4 byte[]

Legend:
N/A: Cannot be used or not applicable

Note
Repetition columns cannot be used.

#1: When java.lang.String is specified in the native interface edition, the data type requested to the server is VARCHAR. When the data type is specified in an output variable, the length of the data acceptance area is assumed to be 32,000 bytes.

#2: When java.math.BigDecimal is used as an output variable in the native interface edition, the precision is set to 15 and the scale to 0.

#3: When the data type is specified with byte[] in the native interface edition, the data type requested to the server is BINARY type. If the HiRDB server is version 06-02 or earlier and the BLOB type is to be used, specify JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBBLOB, which is a HiRDB data type. An error occurs if byte[] is specified.

#4: This type can be specified for the native interface edition.