Data type mapping between HCL OneDB and JDBC data types
Because there are variations between the SQL data types supported by each database vendor, the JDBC API defines a set of generic SQL data types in the class java.sql.Types. Use these JDBC API data types to reference generic SQL types in your Java™ programs that use the JDBC API to connect to HCL OneDB™ databases.
The following table shows the HCL OneDB data type to which each JDBC API data type maps.
JDBC API data type | HCL OneDB data type |
---|---|
BIGINT | INT8, BIGINT, BIGSERIAL |
BINARY | BYTE |
BIT 1 | BOOLEAN |
REF | Not supported |
CHAR | CHAR(n) |
DATE | DATE |
DECIMAL | DECIMAL |
DOUBLE | FLOAT |
FLOAT | FLOAT2 |
INTEGER | INTEGER |
LONGVARBINARY | BYTE or BLOB |
LONGVARCHAR | TEXT or CLOB |
NUMERIC | DECIMAL |
NUMERIC | MONEY |
REAL | SMALLFLOAT |
SMALLINT | SMALLINT |
TIME | DATETIME HOUR TO SECOND2 |
TIMESTAMP | DATETIME YEAR TO FRACTION(5)3 |
TINYINT | SMALLINT |
VARBINARY | BYTE |
VARCHAR | VARCHAR(m,r) |
BOOLEAN | BOOLEAN |
SMALLINT | SMALLINT |
1 With Java 1.4 is , java.sql.Types.BOOLEAN maps to BOOLEAN.
2 This mapping is JDBC compliant. You can map the JDBC FLOAT data type to the HCL OneDB SMALLFLOAT data type for backward compatibility by setting the IFX_SET_FLOAT_AS_SMFLOAT environment variable to 1.
3 HCL OneDB DATETIME types are very restrictive and are not interchangeable. For more information, see Field lengths and date-time data.