Wednesday 1 October 2014

How to Map SQL types to Java

Below table shows how a Java data type maps to JDBC SQL type.

Java Type
JDBC Type
String
CHAR, VARCHAR, or LONGVARCHAR
java.math.BigDecimal
NUMERIC
boolean
BIT
byte
TINYINT
short
SMALLINT
int
INTEGER
long
BIGINT
float
REAL
double
DOUBLE
byte[]
BINARY, VARBINARY or LONGVARBINARY
java.sql.Date
DATE
java.sql.Time
TIME
java.sql.Timestamp
TIMESTAMP
java.sql.Clob
CLOB
java.sql.Blob
BLOB
java.sql.Array
ARRAY
java.sql.Struct
STRUCT
java.sql.Ref
REF
Java class
JAVA_OBJECT



Prevoius                                                 Next                                                 Home

No comments:

Post a Comment