Try OpenEdge Now
skip to main content
SQL Reference
JDBC Reference : JDBC Conformance Notes : Supported data types
 

Supported data types

The Data Direct JDBC Driver supports standard JDBC mapping of JDBC data types to corresponding Java data types.
In the JDBC methods CallableStatement.getXXX and PreparedStatement.setXXX methods, XXX is a Java type:
*For setXXX methods, the driver converts the Java data type to the JDBC data type shown in the table below before sending it to the database.
The following table provides details on data type mapping between Java and JDBC data types.
Table 59. Mapping between Java and JDBC data types
Java data type
JDBC data type
Boolean
BIT
Byte
TINYINT
byte [ ]
LONGVARBINARY
byte [ ]
VARBINARY
double
DOUBLE
float
REAL
Int
INTEGER
java.math.BigDecimal
NUMERIC, DECIMAL
java.sql.Date
DATE
java.sql.Time
TIME
java.sql.Timestamp
TIMESTAMP
Short
SMALLINT
String
VARCHAR
*For getXXX methods, the driver converts the JDBC data type returned by the database to the Java data type (shown in the tables below) before returning it to the getXXX method.
The following table details mapping between JDBC and Java data types.
Table 60. Mapping between JDBC and Java data types
JDBC data type
Java data type
BIT
boolean
CHAR
String
DECIMAL
java.math.BigDecimal
INTEGER
int
NUMERIC
java.math.BigDecimal
SMALLINT
short
TINYINT
byte
VARCHAR
String
The following table details mapping between SQL-92 and Java data types.
Table 61. Mapping between SQL‑92 and Java data types
SQL‑92 data type
Java data type
BINARY
byte[ ]
BIT
boolean
CHAR, VARCHAR
String
DATE
java.sql.Date
DECIMAL
java.math.BigDecimal
DOUBLE PRECISION
Double
FLOAT
Float
INTEGER
Integer
LONGVARBINARY
byte[ ]
NUMERIC
java.math.BigDecimal
REAL
Float
SMALLINT
short
TIME
java.sql.Time
TIMESTAMP
java.sql.Timestamp
TINYINT
byte[ ]
VARBINARY
byte[ ]
The following table provides information on JDBC data type conversion.
Table 62. JDBC data type conversion
JDBC data type
Converts to . . .
BIGINT
CHAR, DOUBLE, FLOAT, INTEGER, SMALLINT, TINYINT
BINARY
Does not convert to any other data type
BIT
Does not convert to any other data type
CHAR
BIGINT, DATE. DECIMAL, DOUBLE, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TIME, TIMESTAMP, TINYINT, VARCHAR
DATE
CHAR, TIMESTAMP, VARCHAR
DECIMAL
BIGINT, CHAR, DOUBLE, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TINYINT, VARCHAR
DOUBLE
BIGINT, CHAR, DECIMAL, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TINYINT, VARCHAR
FLOAT
BIGINT, CHAR, DECIMAL, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TINYINT, VARCHAR
INTEGER
BIGINT, CHAR, DECIMAL, DOUBLE, FLOAT, NUMERIC, REAL, SMALLINT, TINYINT, VARCHAR
LONGVARBINARY
Does not convert to any other data type
LONGVARCHAR
Does not convert to any other data type
NUMERIC
BIGINT, CHAR, DECIMAL, DOUBLE, FLOAT, INTEGER, REAL, SMALLINT, TINYINT, VARCHAR
REAL
BIGINT, CHAR, DECIMAL, DOUBLE, FLOAT, INTEGER, NUMERIC, SMALLINT, TINYINT, VARCHAR
SMALLINT
BIGINT, CHAR, DECIMAL, DOUBLE, FLOAT, INTEGER, NUMERIC, REAL, TINYINT, VARCHAR
TIME
CHAR, TIMESTAMP
TIMESTAMP
CHAR, DATE, TIME, VARCHAR
TINYINT
BIGINT, CHAR, DECIMAL, DOUBLE, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, VARCHAR
VARBINARY
Does not convert to any other data type
VARCHAR
BIGINT, CHAR, DATE, DECIMAL, DOUBLE, FLOAT, INTEGER, NUMERIC, REAL, SMALLINT, TIME, TIMESTAMP, TINYINT