Data types
- Last Updated: May 30, 2024
- 1 minute read
- DataDirect Connectors
- JDBC
- Documentation
The following table lists the data types supported by the Db2 driver and describes how they are mapped to JDBC data types.
| DB2 Data Type | JDBC Data Type |
|---|---|
| Bigint | BIGINT |
| Binary1 | BINARY |
| Blob | BLOB |
| Char | CHAR |
| Char for Bit Data | BINARY |
| Clob | CLOB |
| Date | DATE or TIMESTAMP 2 |
| DBClob | CLOB or NCLOB 3 |
| Decfloat | DECIMAL |
| Decimal | DECIMAL |
| Double | DOUBLE |
| Float | DOUBLE |
| Graphic | CHAR or NCHAR 4 |
| Integer | INTEGER |
| Long Varchar | LONGVARCHAR |
| Long Varchar for Bit Data | LONGVARBINARY |
| Long Vargraphic | LONGVARCHAR or LONGNVARCHAR 5 |
| Numeric | NUMERIC |
| Real | REAL |
| Rowid 6 | VARBINARY |
| Smallint | SMALLINT |
| Time | TIME |
| Timestamp | TIMESTAMP |
| Timestamp with Time Zone 7 | VARCHAR or TIMESTAMP 8 |
| Varbinary | VARBINARY |
| Varchar | VARCHAR |
| Varchar for Bit Data | VARBINARY |
| Vargraphic | VARCHAR or NVARCHAR 9 |
| XML10,11 | CLOB or SQLXML 12 |
See "Large object (LOB) support" for more information about the Blob, Clob, and DBClob data types. See "Returning and inserting/updating XML data" for more information about the XML data type.
1 Supported only for Db2 for z/OS.
2 For Db2 for Linux/UNIX/Windows with the Oracle
compatibility feature enabled, the Date type maps to the JDBC TIMESTAMP type.
6 Supported only for Db2 for z/OS and Db2 for
i.
7 Supported only for Db2 for z/OS.
8 When FetchTSWTZasTimestamp=
false (default), this data type is mapped to the JDBC
VARCHAR data type; when FetchTSWTZasTimestamp=true, it is mapped to the JDBC TIMESTAMP data type.10 Supported only
for Db2 for Linux/UNIX/Windows and Db2 for i V7R1 and higher.
11 The XML DescribeType property overrides the
mappings for XML data.