SQL Server database type corresponds to data type in Java

Source: Internet
Author: User
Tags java se

The following table lists the default mappings between the basic SQL Server, JDBC, and Java programming language data types:

SQL Server Type JDBC Type (java.sql.Types) Java Language Types

bigint

BIGINT

Long

Timestamp

Binary

BINARY

Byte[]

Bit

BIT

Boolean

Char

CHAR

String

Decimal

Money

SmallMoney

DECIMAL

Java.math.BigDecimal

Float

DOUBLE

Double

Int

INTEGER

Int

Image

varbinary (max)

LongVarBinary

Byte[]

varchar (max)

Text

LongVarChar

String

NChar

CHAR

NCHAR (Java SE 6.0)

String

nvarchar

VARCHAR

NVARCHAR (Java SE 6.0)

String

nvarchar (max)

ntext

LongVarChar

Longnvarchar (Java SE 6.0)

String

Numeric

NUMERIC

Java.math.BigDecimal

Real

REAL

Float

smallint

SMALLINT

Short

Datetime

smalldatetime

TIMESTAMP

Java.sql.Timestamp

varbinary

Udt

VARBINARY

Byte[]

varchar

VARCHAR

String

tinyint

TINYINT

Short

uniqueidentifier

CHAR

String

Xml

LongVarChar

SQLXML (Java SE 6.0)

String

SQLXML

Time

Time (1)

Java.sql.Time (1)

Date

DATE

Java.sql.Date

DateTime2

TIMESTAMP

Java.sql.Timestamp

DateTimeOffset (2)

Microsoft.sql.Types.DATETIMEOFFSET

Microsoft.sql.DateTimeOffset

SQL Server database type corresponds to data type in Java

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.