background image
<< java.sql.ResultSetMetaData interface | Implementation notes on java.sql.Blob methods >>

Mapping of java.sql.Types to SQL types

<< java.sql.ResultSetMetaData interface | Implementation notes on java.sql.Blob methods >>
Derby Reference Manual
317
Table 126.
Mapping of java.sql.Types to SQL types
java.sql.Types
SQL Types
BIGINT
BIGINT
BINARY
CHAR FOR BIT DATA
BLOB
BLOB
BOOLEAN
BOOLEAN
CHAR
CHAR
CLOB
CLOB
DATE
DATE
DECIMAL
DECIMAL
DOUBLE
DOUBLE PRECISION
FLOAT
DOUBLE PRECISION
1
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
SQLXML
2
XML
TIME
TIME
TIMESTAMP
TIMESTAMP
VARBINARY
VARCHAR FOR BIT DATA
VARCHAR
VARCHAR
Notes:
1. 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.
2. SQLXML is only valid in JDBC 4.0 and later environments. SQLXML corresponds
to the SQL type XML in Derby. However, Derby does not recognize the
java.sql.Types.SQLXML data type and does not support any JDBC-side operations
for the XML data type. Support for XML and the related operators is implemented
only at the SQL layer. See
XML data types
for more.
Mapping of java.sql.Blob and java.sql.Clob interfaces
In the JDBC API, java.sql.Blob is the mapping for the SQL BLOB (binary large object)
type; java.sql.Clob is the mapping for the SQL CLOB (character large object) type. BLOB
and CLOB objects are collectively referred to as LOBs (large objects).
The Derby implementation of the java.sql.Blob and java.sql.Clob interfaces is
LOCATOR-based, meaning that the implementation provides a logical pointer to a LOB