Mapping of java.sql.Types to SQL types

Mapping of java.sql.Types to SQL Types shows the mapping of java.sql.Types to SQL types.
Table 1. Mapping of java.sql.Types to SQL Types
java.sql.Types SQL Types
BIGINT BIGINT
BINARY CHAR FOR BIT DATA
BIT1 CHAR FOR BIT DATA
BLOB BLOB (JDBC 2.0 and up)
CHAR CHAR
CLOB CLOB (JDBC 2.0 and up)
DATE DATE
DECIMAL DECIMAL
DOUBLE DOUBLE PRECISION
FLOAT DOUBLE PRECISION2
INTEGER INTEGER
LONGVARBINARY LONG VARCHAR FOR BIT DATA
LONGVARCHAR LONG VARCHAR
NULL Not a data type; always a value of a particular type
NUMERIC DECIMAL
REAL REAL
SMALLINT SMALLINT
TIME TIME
TIMESTAMP TIMESTAMP
VARBINARY VARCHAR FOR BIT DATA
VARCHAR VARCHAR
Notes:
  1. BIT is only valid in JDBC 2.0 and earlier environments.
  2. Values can be passed in using the FLOAT type code; however, these are stored as DOUBLE PRECISION values, and so always have the type code DOUBLE when retrieved.
Related concepts
Core JDBC java.sql Classes, Interfaces, and Methods
Related reference
java.sql.Driver
java.sql.DriverManager.getConnection
java.sql.Driver.getPropertyInfo
java.sql.Connection
java.sql.DatabaseMetaData
java.sql.Statement
java.sql.PreparedStatement
java.sql.CallableStatement
java.sql.ResultSet
java.sql.ResultSetMetaData
java.sql.SQLException
java.sql.SQLWarning
java.sql.Blob and java.sql.Clob
java.sql.Connection
java.sql.ResultSet
java.sql.Statement
java.sql.PreparedStatement
java.sql.CallableStatement
java.sql.DatabaseMetaData
java.sql.ResultSetMetaData
java.sql.BatchUpdateException
JDBC Package for Connected Device Configuration/Foundation Profile (JSR169)
JDBC 3.0-only features
java.sql.Connection
java.sql.DatabaseMetaData
java.sql.ParameterMetaData
java.sql.PreparedStatement
java.sql.Savepoint
java.sql.Statement
JDBC escape syntax