Standard SQL Data Types with Their Java Equivalents
SQL type Java Type Description
BINARY byte[] Byte array. Used for binary large objects.
BIT boolean Boolean 0 / 1 value
CHAR String Fixed-length character string.
DATETIME java.sql.Date Date and Time as: yyyy-mm-dd hh:mm:ss
DECIMAL java.math.BigDecimal Arbitrary-precision signed decimal numbers.
FLOAT double Floating-point number, mapped to double
INTEGER int 32-bit integer values
LONGVARBINARY byte[] Variable-length character string.
LONGVARCHAR String Variable-length character string.
NCHAR String National Character Unicode fixed-length character string
NUMERIC java.math.BigDecimal Arbitrary-precision signed decimal numbers.
NTEXT String Large string variables.
NVARCHAR String National Character Unicode variable-length character string
REAL float Floating-point number, mapped to float
SMALLINT short 16-bit integer values
TIME java.sql.Time Thin wrapper around java.util.Date
TIMESTAMP java.sql.Timestamp Composite of a java.util.Date and a separate nanosecond value
VARBINARY byte[] Byte array
VARCHAR String Variable-length character string.
Related examples in the same category