mysql 与 java 数据类型对应表
java数据类型包装类 |
java数据类型 |
mysql数据库 |
java.lang.Byte |
byte |
Tinyint |
java.lang.Short |
short |
Smallint |
java.lang.Integer |
integer |
Ingeger |
java.lang.Long |
long |
Bigint |
java.lang.Float |
float |
Float |
java.lang.Double |
double |
Double |
java.lang.BigDecimal |
big_decimal |
Numeric |
java.lang.Boolean |
boolean |
Bit |
java.lang.String |
string |
Varchar |
java.lang.Boolean |
yes_no |
Char(1)('Y'或'N') |
java.lang.Boolean |
true_false |
Char(1)('Y'或'N') |
java.uitl.Date / java.sql.Date |
date |
Date |
java.sql.Time |
time |
Time |
java.sql.Timestamp |
timestamp |
Timestamp |
java.uitl.Calendar |
celendar |
Timestamp |
java.uitl.Calendar |
calendar |
Timestamp |
java.io.Serializable |
serializable |
Varbinary/Blob |
java.sql.Clob |
clob |
Clob |
java.sql.Blob |
blob |
Blob |
java.lang.Class |
class |
Varchar |
java.uitl.Locale |
locale |
Varchar |
java.uitl.TimeZone |
timezone |
Varchar |
java.uitl.Currency |
currency |
Varchar |