MySQL Type Name

Return value of

GetColumnClassName

Returned as Java Class

BIT(1) (new in MySQL-5.0)

BIT

java.lang.Boolean

BIT( > 1) (new in MySQL-5.0)

BIT

byte[]

TINYINT

TINYINT

java.lang.Boolean if the configuration property tinyInt1isBit is set to true (the default) and the storage size is 1, orjava.lang.Integer if not.

BOOL, BOOLEAN

TINYINT

See TINYINT, above as these are aliases forTINYINT(1), currently.

SMALLINT[(M)] [UNSIGNED]

SMALLINT [UNSIGNED]

java.lang.Integer (regardless ifUNSIGNED or not)

MEDIUMINT[(M)] [UNSIGNED]

MEDIUMINT [UNSIGNED]

java.lang.Integer, if UNSIGNEDjava.lang.Long (C/J 3.1 and earlier), orjava.lang.Integer for C/J 5.0 and later

INT,INTEGER[(M)] [UNSIGNED]

INTEGER [UNSIGNED]

java.lang.Integer, if UNSIGNEDjava.lang.Long

BIGINT[(M)] [UNSIGNED]

BIGINT [UNSIGNED]

java.lang.Long, if UNSIGNEDjava.math.BigInteger

FLOAT[(M,D)]

FLOAT

java.lang.Float

DOUBLE[(M,B)]

DOUBLE

java.lang.Double

DECIMAL[(M[,D])]

DECIMAL

java.math.BigDecimal

DATE

DATE

java.sql.Date

DATETIME

DATETIME

java.sql.Timestamp

TIMESTAMP[(M)]

TIMESTAMP

java.sql.Timestamp

TIME

TIME

java.sql.Time

YEAR[(2|4)]

YEAR

If yearIsDateType configuration property is set to false, then the returned object type isjava.sql.Short. If set to true (the default), then the returned object is of typejava.sql.Date with the date set to January 1st, at midnight.

CHAR(M)

CHAR

java.lang.String (unless the character set for the column is BINARY, then byte[] is returned.

VARCHAR(M) [BINARY]

VARCHAR

java.lang.String (unless the character set for the column is BINARY, then byte[] is returned.

BINARY(M)

BINARY

byte[]

VARBINARY(M)

VARBINARY

byte[]

TINYBLOB

TINYBLOB

byte[]

TINYTEXT

VARCHAR

java.lang.String

BLOB

BLOB

byte[]

TEXT

VARCHAR

java.lang.String

MEDIUMBLOB

MEDIUMBLOB

byte[]

MEDIUMTEXT

VARCHAR

java.lang.String

LONGBLOB

LONGBLOB

byte[]

LONGTEXT

VARCHAR

java.lang.String

ENUM('value1','value2',...)

CHAR

java.lang.String

SET('value1','value2',...)

CHAR

java.lang.String

Java&MySQL Type Mapping的更多相关文章

  1. Mysql Java type mapping

    MySQL Type Java Type ---------- --------- CHAR String VARCHAR String LONGVARCHAR String NUMERIC java ...

  2. JAXB - Annotations, Type Mapping: XmlSchemaType

    The annotation XmlSchemaType defines a mapping between an arbitrary Java type and a simple schema bu ...

  3. Java Mysql连接池配置和案例分析--超时异常和处理

    前言: 最近在开发服务的时候, 发现服务只要一段时间不用, 下次首次访问总是失败. 该问题影响虽不大, 但终究影响用户体验. 观察日志后发现, mysql连接因长时间空闲而被关闭, 使用时没有死链检测 ...

  4. java mysql 日期类型

    mysql(版本:5.1.50)的时间日期类型如下: datetime 8bytes xxxx-xx-xx xx:xx:xx 1000-01-01 00:00:00到9999-12-31 23:59: ...

  5. 阿里云上安装mysql步骤/ 阿里云ECS搭建Java+mysql+tomcat环境

    使用阿里云ECS挺长一段时间了.这两天碰巧朋友小白让我一步一步教他在ECS上搭建Java+mysql+tomcat环境,所以把在这里把步骤在这简单整理了一下,以便需要的人查阅. 我购买的阿里云服务器系 ...

  6. Java mysql 日期相关

    获取当前系统时间和日期并格式化输出: import java.util.Date;import java.text.SimpleDateFormat; public class NowString { ...

  7. java generic type

    java generic type: 类型安全.类型参数化.不需要强制转换

  8. java mysql模板

    Java mysql的模版,很优雅.同时也兼顾了性能PreparedStatement和安全性(防SQL注入)两方面.对于比较简单的数据库操作基本满足要求. package dao; import j ...

  9. C# 制作Java +Mysql+Tomcat 环境安装程序,一键式安装

    原文:C# 制作Java +Mysql+Tomcat 环境安装程序,一键式安装 要求: JDK.Mysql.Tomcat三者制作成一个安装包, 不能单独安装,安装过程不显示三者的界面, 安装完成要配置 ...

随机推荐

  1. JavaScript 作用域和作用域链

    作用域是JavaScript最重要的概念之一,想要学好JavaScript就需要理解JavaScript作用域和作用域链的工作原理.今天这篇文章对JavaScript作用域和作用域链作简单的介绍,希望 ...

  2. centos 6.5 x64编译有python的vim7.4

    wget ftp://ftp.vim.org/pub/vim/extra/vim-7.2-extra.tar.gzwget ftp://ftp.vim.org/pub/vim/extra/vim-7. ...

  3. html5 css3 如何绘制扇形任意角度

    扇形制作原理,底部一个纯色原形,里面2个相同颜色的半圆,可以是白色,内部半圆按一定角度变化,就可以产生出扇形效果 <html> <head> <meta charset= ...

  4. mcollective安装过程

    参考 http://kisspuppet.com/2013/11/10/mcollective-middleware/ http://5lexin.com/blog/view/225/mco-ping ...

  5. Java琐记

    svn项目倒入,所选的文件夹一定是src上面以及的:然后eclipse会自动创建一个项目,项目名称就是src上级文件夹的名称:然后会按照路径下的文档结构如导入到eclipse的结构中: 被标记为// ...

  6. 10 Best Responsive HTML5 Frameworks and Tools

    http://designinstruct.com/roundups/html5-frameworks/

  7. <三> SQL杂七杂八

    批量插入测试数据 use Testdeclare @count INTset @count = 0while(@count < 10)begin waitfor delay '000:00:10 ...

  8. <七> jQuery 设置内容和属性

    设置内容 text() - 设置或返回所选元素的文本内容 html() - 设置或返回所选元素的内容(包括 HTML 标记) val() - 设置或返回表单字段的值 设置属性 jQuery attr( ...

  9. winform 项目获取app.config 中appSettings节点数据

    <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSe ...

  10. DEPRECATED: Use of this script to execute hdfs command is deprecated.

    DEPRECATED: Use of this script to execute hdfs command is deprecated. 本人安装的hadoop版本是2.4.0的,但每次执行命令时都 ...