Java and MySQL data type comparison table

Source: Internet
Author: User
Tags comparison table

Type name

Display length

Database type

Java type

VARCHAR

L+n

VARCHAR

Java.lang.String

CHAR

N

CHAR

Java.lang.String

Blob

L+n

Blob

Java.lang.byte[]

TEXT

65535

VARCHAR

Java.lang.String

INTEGER

4

INTEGER UNSIGNED

Java.lang.Long

TINYINT

3

TINYINT UNSIGNED

Java.lang.Integer

SMALLINT

5

SMALLINT UNSIGNED

Java.lang.Integer

Mediumint

8

Mediumint UNSIGNED

Java.lang.Integer

BIT

1

BIT

Java.lang.Boolean

BIGINT

20

BIGINT UNSIGNED

Java.math.BigInteger

FLOAT

4+8

FLOAT

Java.lang.Float

DOUBLE

22

DOUBLE

Java.lang.Double

DECIMAL

11

DECIMAL

Java.math.BigDecimal

BOOLEAN

1

With tinyint

Java.lang.Boolean

DATE

10

DATE

Java.sql.Date

Time

8

Time

Java.sql.Time

Datetime

19

Datetime

Java.sql.Timestamp

TIMESTAMP

19

TIMESTAMP

Java.sql.Timestamp

Reprint: http://ju.outofmemory.cn/entry/22288

Java and MySQL data type comparison table

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.