sql type—java type数据关系
SQL Data Type | JAVA Data Type |
---|---|
bigint | BIGINT |
binary | BINARY |
bit | BIT |
char | CHAR |
datetime | TIMESTAMP |
decimal | ECIMAL |
float | FLOAT |
image | LONGVARBINARY |
int | INTEGER |
money | DECIMAL |
nchar | CHAR |
ntext | LONGVARCHAR |
numeric | NUMERIC |
nvarchar | VARCHAR |
real | REAL |
smalldatetime | TIMESTAMP |
smallint | SMALLINT |
smallmoney | DECIMAL |
sql_variant | VARCHAR |
sysname | VARCHAR |
text | LONGVARCHAR |
timestamp | BINARY |
tinyint | TINYINT |
uniqueidentifier | CHAR |
varbinary | VARBINARY |
varchar | VARCHAR |
jdbc data type——java data type之间的mapping
JDBC Type | Java Type |
---|---|
CHAR | String |
VARCHAR | String |
LONGVARCHAR | String |
NUMERIC | java.math.BigDecimal |
DECIMAL | java.math.BigDecimal |
BIT | boolean |
BOOLEAN | boolean |
TINYINT | byte |
SMALLINT | short |
INTEGER | int |
BIGINT | long |
REAL | float |
FLOAT | double |
DOUBLE | double |
BINARY | byte[] |
VARBINARY | byte[] |
LONGVARBINARY | byte[] |
DATE | java.sql.Date |
TIME | java.sql.Time |
TIMESTAMP | java.sql.Timestamp |
CLOB | Clob |
BLOB | Blob |
ARRAY | Array |
DATALINK | java.net.URL |
JAVA_OBJECT | underlying Java class |