从 JDBC 类型映射到 Java 类型
JDBC 类型 | Java 类型 |
CHAR |
String |
VARCHAR |
String |
LONGVARCHAR |
String |
NUMERIC |
java.math.BigDecimal |
DECIMAL |
java.math.BigDecimal |
BIT |
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 |
从 Java 类型映射到 JDBC 类型
Java 类型 | JDBC 类型 |
String |
VARCHAR 或 LONGVARCHAR |
java.math.BigDecimal |
NUMERIC |
boolean |
BIT |
byte |
TINYINT |
short |
SMALLINT |
int |
INTEGER |
long |
BIGINT |
float |
REAL |
double |
DOUBLE |
byte[] |
VARBINARY 或 LONGVARBINARY |
java.sql.Date |
DATE |
java.sql.Time |
TIME |
java.sql.Timestamp |
TIMESTAMP |
摘取了部分,详细内容:http://www.cnblogs.com/shishm/archive/2012/01/30/2332142.html