Oracle JDBC Mapping
SQL and PL/SQL Data Type | Oracle Mapping | JDBC Mapping |
---|---|---|
CHAR , CHARACTER , LONG , STRING , VARCHAR , VARCHAR2 | oracle.sql.CHAR | java.lang.String |
NCHAR , NVARCHAR2 | oracle.sql.NCHAR (note 1) | oracle.sql.NString (note 1) |
NCLOB | oracle.sql.NCLOB (note 1) | oracle.sql.NCLOB (note 1) |
RAW , LONG RAW | oracle.sql.RAW | byte[] |
BINARY_INTEGER , NATURAL , NATURALN , PLS_INTEGER , POSITIVE , POSITIVEN ,SIGNTYPE , INT , INTEGER | oracle.sql.NUMBER | int |
DEC , DECIMAL , NUMBER , NUMERIC | oracle.sql.NUMBER | java.math.BigDecimal |
DOUBLE PRECISION , FLOAT | oracle.sql.NUMBER | double |
SMALLINT | oracle.sql.NUMBER | int |
REAL | oracle.sql.NUMBER | float |
DATE | oracle.sql.DATE | java.sql.Timestamp |
TIMESTAMP TIMESTAMP WITH TZ TIMESTAMP WITH LOCAL TZ | oracle.sql.TIMESTAMP oracle.sql.TIMESTAMPTZ oracle.sql.TIMESTAMPLTZ | java.sql.Timestamp |
INTERVAL YEAR TO MONTH INTERVAL DAY TO SECOND | String (note 2) | String (note 2) |
ROWID , UROWID | oracle.sql.ROWID | oracle.sql.ROWID |
BOOLEAN | boolean (note 3) | boolean (note 3) |
CLOB | oracle.sql.CLOB | java.sql.Clob |
BLOB | oracle.sql.BLOB | java.sql.Blob |
BFILE | oracle.sql.BFILE | oracle.sql.BFILE |
Object types
|
Generated class
|
Generated class
|
SQLJ object types
|
Java class defined at type creation
|
Java class defined at type creation
|
OPAQUE types |
Generated or predefined class (note 4)
|
Generated or predefined class (note 4)
|
RECORD types |
Through mapping to SQL object type (note 5)
|
Through mapping to SQL object type (note 5)
|
Nested table,
VARRAY |
Generated class implemented using
oracle.sql.ARRAY | java.sql.Array |
Reference to object type
|
Generated class implemented using
oracle.sql.REF | java.sql.Ref |
REF CURSOR | java.sql.ResultSet | java.sql.ResultSet |
Index-by tables
|
Through mapping to SQL collection (note 6)
|
Through mapping to SQL collection (note 6)
|
Scalar (numeric or character)
Index-by tables
|
Through mapping to Java array (note 7)
|
Through mapping to Java array (note 7)
|
No comments:
Post a Comment