The following table lists the data types supported by the Db2 driver and describes how they are mapped to JDBC data types.

Table 1. DB2 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.
3 When JDBCBehavior=1, the first value applies and when JDBCBehavior=0, the second value applies.
4 When JDBCBehavior=1, the first value applies and when JDBCBehavior=0, the second value applies.
5 When JDBCBehavior=1, the first value applies and when JDBCBehavior=0, the second value applies.
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.
9 When JDBCBehavior=1, the first value applies and when JDBCBehavior=0, the second value applies.
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.
12 When JDBCBehavior=1, the first value applies and when JDBCBehavior=0, the second value applies.