uCosminexus Application Server, EJB Container Functionality Guide
This section describes the mapping of the CMP field and database. The mapping will differ for each type of database.
The following table describes the mapping of the CMP field and database for HiRDB.
In the following table, Java data type is the data type of Java supported by CMP, JDBC data type is the java.sql.Types. data type of the JDBC corresponding to the data type of Java, and SQL data type is the DB column type recommended for mapping with the Java data type:
Table 2-11 Mapping of the CMP field and database (when using HiRDB)
Java data type | JDBC data type | SQL data type |
---|---|---|
boolean | SMALLINT | SMALLINT |
java.lang.Boolean | ||
byte | SMALLINT | SMALLINT |
java.lang.Byte | ||
char#1 | CHAR | CHAR(4) |
java.lang.Character#1 | ||
short | SMALLINT | SMALLINT |
java.lang.Short | ||
int | INTEGER | INTEGER |
java.lang.Integer | ||
long | DECIMAL | DECIMAL(22) |
java.lang.Long | ||
float | REAL | REAL, SMALLFLT |
java.lang.Float | ||
double | FLOAT | DOUBLE PRECISION |
java.lang.Double | ||
byte[]#2 | LONGVARBINARY | BLOB |
java.lang.String#1 | VARCHAR | VARCHAR(m) CHAR(n) MVARCHAR(m) MCHAR(n) NVARCHAR(x) NCHAR(y)#3 |
java.math.BigDecimal | DECIMAL | DECIMAL(m,n)#4 |
java.sql.Date | DATE | DATE#5 |
java.sql.Time | TIME | TIME |
java.sql.TimeStamp#6 | CHAR | CHAR(29) |
Serializable type#2 | LONGVARBINARY | BLOB |
The following table describes the mapping of the CMP field and the database for Oracle.
In the following table, Java data type is the data type of Java supported by CMP, JDBC data type is the java.sql.Types. data type of the JDBC corresponding to the data type of Java, and SQL data type is the DB column type that is recommended for the mapping with the Java data type:
Table 2-12 Mapping of the CMP field and database (when using Oracle)
Java data type | JDBC data type | SQL data type |
---|---|---|
boolean | NUMERIC | NUMBER(38) |
java.lang.Boolean | ||
byte | NUMERIC | NUMBER(38) |
java.lang.Byte | ||
char#1 | CHAR | CHAR(4) |
java.lang.Character#1 | ||
short | NUMERIC | NUMBER(38) |
java.lang.Short | ||
int | NUMERIC | NUMBER(38) |
java.lang.Integer | ||
long | NUMERIC | NUMBER(22) |
java.lang.Long | ||
float | NUMERIC | NUMBER |
java.lang.Float | ||
double#2 | FLOAT | FLOAT(126) |
java.lang.Double#2 | ||
byte[]#3 | LONGVARBINARY | LONG RAW |
java.lang.String#1 | VARCHAR | VARCHAR(m) CHAR(n) LONG#4 |
java.math.BigDecimal | NUMERIC | NUMBER(m,n)#5 |
java.sql.Date | DATE | DATE#6#7 |
java.sql.Time | CHAR | CHAR(8)#8 |
java.sql.TimeStamp | TimeStamp | DATE#7 #9 |
Serializable type#3 | LONGVARBINARY | LONG RAW |
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.