Release 10.1A: OpenEdge Data Management:
SQL Reference

> ## 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 Table 58 before sending it to the database.

> Table 58 provides details on data type mapping between Java and JDBC data types.

> Table 58: 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 Table 59, Table 60, and Table 61 before returning it to the `getXXX` method.

> Table 59 details mapping between JDBC and Java data types.

> Table 59: 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`

> Table 60: 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[ ]

> Table 61 provides information on JDBC data type conversion.

> Table 61: 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

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095