Home > Database > Mysql Tutorial > body text

Java数据类型和MySql数据类型对照表

WBOY
Release: 2016-06-07 15:18:24
Original
1555 people have browsed it

类型名称 显示长度 数据库类型 JAVA类型 JDBC类型索引(int) 描述 VARCHAR LN VARCHAR java.lang.String 12 CHAR N CHAR java.lang.String 1 BLOB LN BLOB java.lang.byte[] -4 TEXT 65535 VARCHAR java.lang.String -1 INTEGER 4 INTEGER UNSIGNED java.lang

类型名称 显示长度 数据库类型 JAVA类型 JDBC类型索引(int) 描述
           
VARCHAR L+N VARCHAR java.lang.String 12  
CHAR N CHAR java.lang.String 1  
BLOB L+N BLOB java.lang.byte[] -4  
TEXT 65535 VARCHAR java.lang.String -1  
           
INTEGER 4 INTEGER UNSIGNED java.lang.Long 4  
TINYINT 3 TINYINT UNSIGNED java.lang.Integer -6  
SMALLINT 5 SMALLINT UNSIGNED java.lang.Integer 5  
MEDIUMINT 8 MEDIUMINT UNSIGNED java.lang.Integer 4  
BIT 1 BIT java.lang.Boolean -7  
BIGINT 20 BIGINT UNSIGNED java.math.BigInteger -5  
FLOAT 4+8 FLOAT java.lang.Float 7  
DOUBLE 22 DOUBLE java.lang.Double 8  
DECIMAL 11 DECIMAL java.math.BigDecimal 3  
BOOLEAN 1 同TINYINT      
           
ID 11 PK (INTEGER UNSIGNED) java.lang.Long 4  
           
DATE 10 DATE java.sql.Date 91  
TIME 8 TIME java.sql.Time 92  
DATETIME 19 DATETIME java.sql.Timestamp 93  
TIMESTAMP 19 TIMESTAMP java.sql.Timestamp 93  
YEAR 4 YEAR java.sql.Date 91





     

     在进行数据库设计或者项目更改数据库环境时,这张表很实用。       

     参考资料:http://www.cnblogs.com/JemBai/archive/2009/08/20/1550683.html





Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template