各大数据库类型与JDBC中介数据类型的转换对比
??
MYSQL
SQL SERVER
JDBC
ORACLE
DB2
1
BIGINT(0-255)
BIGINT
BIGINT
BIGINT
NUMBER(1-38,-84-127)
NUMBER(1-38)
NUMBER
BIGINT
2
BINARY(0-255)
BINARY
VARBINARY(0-8000)
BINARY(1-8000)
BINARY
BINARY
RAW(1-2000)
LONG RAW
CHAR(1-255) FOR BIT DATA
VARCHAR(1-32672) FOR BIT DATA
3
BIT(0-64)
BIT
BINARY(1-8000)
BIT
BIT
RAW(1-2000)
?
CHAR(1-255) FOR BIT DATA
?
4
LONGBLOB
IMAGE
BLOB
BLOB
BLOB
5
CHAR(0-255)
CHAR
VARCHAR(0-8000)
?
CHAR(1-8000)
CHAR
NCHAR(1-4000)
NCHAR
CHAR
CHAR(1-2000)
CHAR
NCHAR(1-1000)
NCHAR
LONG
CHAR(1-254)
VARCHAR(1-32672)
CHAR
6
LONGTEXT
NTEXT
TEXT
CLOB
CLOB
CLOB
7
DATE
DATETIME
DATE
DATE
DATE
8
DECIMAL (0-65,0-30)
DECIMAL (0-65)
DECIMAL
DATETIME(1-38,0-38)
DATETIME(1-38)
DATETIME
DECIMAL
NUMBER(1-38,-84-127)
NUMBER(1-38)
NUMBER
DECIMAL (1-31,0-31)
DECIMAL (1-31)
DECIMAL
9
DOUBLE(0-255,0-30)
DOUBLE
FLOAT(1-53)
FLOAT
DOUBLE
NUMBER(1-38,-84-127)
NUMBER(1-38)
NUMBER
DOUBLE
10
FLOAT(0-255,0-30)
FLOAT(0-53)
FLOAT(1-53)
FLOAT
FLOAT
FLOAT(1-126)
FLOAT
DECIMAL (1-31,0-31)
DECIMAL (1-31)
DECIMAL
11
INTEGER(0-255)
INTEGER
INT
INTEGER
NUMBER(1-38,-84-127)
NUMBER(1-38)
NUMBER
INTEGER
12
LONG VARBINARY
IMAGE
LONGVARBINARY
LONG RAW
LONG VARCHAR FOR BIT DATA
13
LONG VARCHAR
NTEXT
LONGVARCHAR
LONG
LONG VARCHAR
14
NUMERIC(0-65,0-30)
NUMERIC(0-65)
NUMERIC
NUMERIC(1-38,0-38)
NUMERIC(1-38)
NUMERIC
NUMERIC
NUMBER(1-38,-84-127)
NUMBER(1-38)
NUMBER
DECIMAL (1-31,0-31)
DECIMAL (1-31)
DECIMAL
15
FLOAT(0-255,0-30)
FLOAT(0-53)
FLOAT
REAL
REAL
NUMBER(1-38,-84-127)
NUMBER(1-38)
NUMBER
REAL
16
SMALLINT(0-255)
SMALLINT
SMALLINT
SMALLINT
NUMBER(1-38,-84-127)
NUMBER(1-38)
NUMBER
SMALLINT
17
TIME
DATETIME
DATETIME
TIME
TIMESTAMP
TIME
18
DATETIME
TIMESTAMP
DATETIME
TIMESTAMP
TIMESTAMP
TIMESTAMP
19
TINYINT(0-255)
TINYINT
TINYINT
TINYINT
NUMBER(1-38,-84-127)
NUMBER(1-38)
NUMBER
SMALLINT
20
VARBINARY(0-8000)
LONG VARBINARY
VARBINARY(1-8000)
VARBINARY
IMAGE
VARBINARY
RAW(1-2000)
LONG RAW
VARCHAR(1-32672) FOR BIT DATA
LONG VARCHAR FOR BIT DATA
21
VARCHAR(0-8000)
LONG VARCHAR
VARCHAR(1-8000)
VARCHAR
NVARCHAR(1-4000)
NVARCHAR
NTEXT
VARCHAR
VARCHAR2(1-4000)
NVARCHAR2(1-2000)
LONG
?
VARCHAR(1-32672)
LONG VARCHAR
?