Scalable Database Server, HiRDB Version 8 UAP Development Guide

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

18.3.4 Correspondence between HiRDB data types and SQLJ data types

Table 18-4 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 18-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
CHAR1 java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBCHAR4 N/A
VARCHAR java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBVARCHAR4 N/A
NCHAR1 java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBNCHAR4 N/A
NVARCHAR1 java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBNVARCHAR4 N/A
MCHAR1 java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBMCHAR4 N/A
MVARCHAR1 java.lang.String N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBMVARCHAR4 N/A
DECIMAL2 java.math.BigDecimal N/A
JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBDECIMAL4 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
BLOB3 JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBBLOB4 byte[]
BINARY JP.co.Hitachi.soft.HiRDB.pdjpp.runtime.HiRDBBINARY4 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 version, 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 version, the precision is set to 15 and the scale to 0.

3 When the data type is specified with byte[] in the native interface version, 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 version.