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.

SQL JDBC/Java
VARCHAR java.lang.String
CHAR java.lang.String
LONGVARCHAR java.lang.String
BIT boolean
NUMERIC java.math.BigDecimal
TINYINT byte
SMALLINT short
INTEGER int
BIGINT long
REAL float
FLOAT float
DOUBLE double
VARBINARY byte[ ]
BINARY byte[ ]
DATE java.sql.Date
TIME java.sql.Time
TIMESTAMP java.sql.Timestamp
CLOB java.sql.Clob
BLOB java.sql.Blob
ARRAY java.sql.Array
REF java.sql.Ref
STRUCT java.sql.Struct
Updated on: 2019-07-30T22:30:25+05:30

242 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements