background image
<< Argument matching | SQL reserved words >>

SQL and Java type correspondence

<< Argument matching | SQL reserved words >>
Derby Reference Manual
207
...would match all of the following methods:
public static double toDegrees( double arg ) {...}
public static Double toDegrees( double arg ) {...}
public static double toDegrees( Double arg ) {...}
public static Double toDegrees( Double arg ) {...}
Note that Derby would raise an exception if it found more than one matching method.
Mapping SQL data types to Java data types
The following table shows how Derby maps specific SQL data types to Java data types.
Table 14.
SQL and Java type correspondence
SQL Type
Primitive Match
Wrapper Match
BOOLEAN
boolean
java.lang.Boolean
SMALLINT
short
java.lang.Integer
INTEGER
int
java.lang.Integer
BIGINT
long
java.lang.Long
DECIMAL
None
java.math.BigDecimal
NUMERIC
None
java.math.BigDecimal
REAL
float
java.lang.Float
DOUBLE
double
java.lang.Double
FLOAT
double
java.lang.Double
CHAR
None
java.lang.String
VARCHAR
None
java.lang.String
LONG VARCHAR
None
java.lang.String
CHAR FOR BIT DATA
byte[]
None
VARCHAR FOR BIT DATA
byte[]
None
LONG VARCHAR FOR BIT
DATA
byte[]
None
CLOB
None
java.sql.Clob
BLOB
None
java.sql.Blob
DATE
None
java.sql.Date
TIME
None
java.sql.Time
TIMESTAMP
None
java.sql.Timestamp
XML
None
None
User-defined type
None
Underlying Java class