Java data type
|
JDBC data type
|
Boolean
|
BIT
|
Byte
|
TINYINT
|
byte [ ]
|
LONGVARBINARY
|
byte [ ]
|
VARBINARY
|
double
|
DOUBLE
|
float
|
REAL
|
Int
|
INTEGER
|
java.math.BigDecimal
|
NUMERIC, DECIMAL
|
java.sql.Date
|
DATE
|
java.sql.Time
|
TIME
|
java.sql.Timestamp
|
TIMESTAMP
|
Short
|
SMALLINT
|
String
|
VARCHAR
|
JDBC data type
|
Java data type
|
BIT
|
boolean
|
CHAR
|
String
|
DECIMAL
|
java.math.BigDecimal
|
INTEGER
|
int
|
NUMERIC
|
java.math.BigDecimal
|
SMALLINT
|
short
|
TINYINT
|
byte
|
VARCHAR
|
String
|
SQL‑92 data type
|
Java data type
|
BINARY
|
byte[ ]
|
BIT
|
boolean
|
CHAR, VARCHAR
|
String
|
DATE
|
java.sql.Date
|
DECIMAL
|
java.math.BigDecimal
|
DOUBLE PRECISION
|
Double
|
FLOAT
|
Float
|
INTEGER
|
Integer
|
LONGVARBINARY
|
byte[ ]
|
NUMERIC
|
java.math.BigDecimal
|
REAL
|
Float
|
SMALLINT
|
short
|
TIME
|
java.sql.Time
|
TIMESTAMP
|
java.sql.Timestamp
|
TINYINT
|
byte[ ]
|
VARBINARY
|
byte[ ]
|
JDBC data type
|
Converts to . . .
|
BIGINT
|
CHAR, DOUBLE, FLOAT, INTEGER, SMALLINT, TINYINT
|
BINARY
|
Does not convert to any other data type
|
BIT
|
Does not convert to any other data type
|
CHAR
|
BIGINT, DATE. DECIMAL, DOUBLE, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TIME, TIMESTAMP, TINYINT, VARCHAR
|
DATE
|
CHAR, TIMESTAMP, VARCHAR
|
DECIMAL
|
BIGINT, CHAR, DOUBLE, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TINYINT, VARCHAR
|
DOUBLE
|
BIGINT, CHAR, DECIMAL, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TINYINT, VARCHAR
|
FLOAT
|
BIGINT, CHAR, DECIMAL, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TINYINT, VARCHAR
|
INTEGER
|
BIGINT, CHAR, DECIMAL, DOUBLE, FLOAT, NUMERIC, REAL, SMALLINT, TINYINT, VARCHAR
|
LONGVARBINARY
|
Does not convert to any other data type
|
LONGVARCHAR
|
Does not convert to any other data type
|
NUMERIC
|
BIGINT, CHAR, DECIMAL, DOUBLE, FLOAT, INTEGER, REAL, SMALLINT, TINYINT, VARCHAR
|
REAL
|
BIGINT, CHAR, DECIMAL, DOUBLE, FLOAT, INTEGER, NUMERIC, SMALLINT, TINYINT, VARCHAR
|
SMALLINT
|
BIGINT, CHAR, DECIMAL, DOUBLE, FLOAT, INTEGER, NUMERIC, REAL, TINYINT, VARCHAR
|
TIME
|
CHAR, TIMESTAMP
|
TIMESTAMP
|
CHAR, DATE, TIME, VARCHAR
|
TINYINT
|
BIGINT, CHAR, DECIMAL, DOUBLE, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, VARCHAR
|
VARBINARY
|
Does not convert to any other data type
|
VARCHAR
|
BIGINT, CHAR, DATE, DECIMAL, DOUBLE, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TIME, TIMESTAMP, TINYINT
|