The following table maps data types for relational
databases.
Table 18: Relational Database Data Type
Mappings
JDBC Type Name
|
Oracle 8.1
|
IBM DB2 5.2 (Unix, NT)
|
Microsoft SQL Server 7.0
|
Microsoft Access 2000
|
BIT
|
|
|
BIT
|
Yes/No
|
TINYINT
|
|
|
TINYINT
|
Number (Byte)
|
SMALLINT
|
SMALLINT, NUMBER(38,0)
|
SMALLINT
|
SMALLINT
|
Number (Integer)
|
INTEGER
|
INTEGER, NUMBER(38,0)
|
INTEGER
|
INTEGER
|
Number (Long Integer)
|
BIGINT
|
|
BIGINT
|
BIGINT
|
|
REAL
|
REAL, NUMBER
|
REAL
|
REAL
|
Number (Single)
|
FLOAT
|
FLOAT, NUMBER
|
FLOAT
|
FLOAT
|
Number (Double)
|
DOUBLE
|
DOUBLE PRECISION, NUMBER
|
DOUBLE
|
DOUBLE PRECISION
|
Number (Double)
|
NUMERIC(p,s)
|
NUMERIC
(p,s,), NUMBER(p,s)
|
NUMERIC(p,s)
|
NUMERIC
(p,s)
|
Numeric
|
DECIMAL(p,s)
|
DECIMAL(p,s), NUMBER(p,s)
|
DECIMAL(p,s)
|
DECIMAL
(p,s), MONEY
|
Decimal
|
CHAR(n)
|
CHAR(n) n <= 2000
|
CHAR(n) n <= 254
|
CHAR(n) n <= 8000
|
|
VARCHAR(n)
|
VARCHAR2
(n) n <= 4000
|
VARCHAR(n) n <= 4000
|
VARCHAR
(n) n <= 8000
|
Text(n)
|
LONGVARCHAR
|
LONG limit is 2 Gigabytes
|
LONG VARCHAR limit is 32,700 bytes
|
TEXT limit is 2 Gigabytes
|
Memo
|
BINARY(n)
|
|
CHAR(n) FOR BIT DATA n < = 254
|
BINARY(n) n <= 8000
|
|
VARBINARY
|
RAW(n) n <= 2000
|
VARCHAR(n) FOR BIT DATA n <= 4000
|
VARBINARY
(n) n <= 8000
|
|
LONGVARBINARY
|
LONG RAW limit is 2 Gigabytes
|
LONG VARCHAR FOR BIT DATA limit is 32,700
bytes
|
IMAGE limit is 2 Gigabytes
|
OLE Object
|
DATE
|
|
DATE
|
|
|
TIME
|
|
TIME
|
|
|
TIMESTAMP
|
DATE
|
TIMESTAMP
|
DATETIME
|
Date/Time
|
CLOB
|
CLOB limit is 4 Gigabytes
|
CLOB(n) n <= 2,147,483,647 bytes
|
|
|
BLOB
|
BLOB, BFILE limit is 4 Gigabytes
|
BLOB(n) n <= 15,000,000 bytes
|
|
|
ARRAY
|
VARRAY
|
|
|
|
STRUCT
|
OBJECT
|
|
|
|
DISTINCT
|
|
|
|
|
REF
|
REF
|
|
|
|
DATALINK
|
|
|
|
|
JAVA_OBJECT
|
|
|
|
|
See Also