What are the data types supported by JDBC?


JDBC provides support for almost all the SQL datatypes Whenever the JDBC driver receives a call from a Java application it converts the Java datatypes in it to the corresponding SQL data types. The conversion process follows default mapping. Following is the list of data types supported by JDBC and their corresponding SQL datatypes.

SQLJDBC/Java
VARCHARjava.lang.String
CHARjava.lang.String
LONGVARCHARjava.lang.String
BITboolean
NUMERICjava.math.BigDecimal
TINYINTbyte
SMALLINTshort
INTEGERint
BIGINTlong
REALfloat
FLOATfloat
DOUBLEdouble
VARBINARYbyte[ ]
BINARYbyte[ ]
DATEjava.sql.Date
TIMEjava.sql.Time
TIMESTAMPjava.sql.Timestamp
CLOBjava.sql.Clob
BLOBjava.sql.Blob
ARRAYjava.sql.Array
REFjava.sql.Ref
STRUCTjava.sql.Struct

Updated on: 30-Jul-2019

191 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements