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 1 BIGINT
Binary 2 BINARY
Blob 3 BLOB
Char CHAR
Char for Bit Data BINARY
Clob CLOB
Date DATE or TIMESTAMP 4
DBClob CLOB or NCLOB 5
Decfloat 6 DECIMAL
Decimal DECIMAL
Double DOUBLE
Float DOUBLE
Graphic CHAR or NCHAR 7
Integer INTEGER
Long Varchar LONGVARCHAR
Long Varchar for Bit Data LONGVARBINARY
Long Vargraphic LONGVARCHAR or LONGNVARCHAR 8
Numeric NUMERIC
Real REAL
Rowid 9 VARBINARY
Smallint SMALLINT
Time TIME
Timestamp TIMESTAMP
Timestamp with Time Zone 10 VARCHAR or TIMESTAMP 11
Varbinary 12 VARBINARY
Varchar VARCHAR
Varchar for Bit Data VARBINARY
Vargraphic VARCHAR or NVARCHAR 13
XML14,15 CLOB or SQLXML 16

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 V9.1 for z/OS.
2 Supported only for DB2 V9.1 for z/OS.
3 Supported only for DB2 V8.1 and higher for Linux/UNIX/Windows, DB2 for z/OS, and DB2 for i V5R2.
4 For DB2 V9.7 for Linux/UNIX/Windows with the Oracle compatibility feature enabled, the Date type maps to the JDBC TIMESTAMP type.
5 When JDBCBehavior=0, the data type depends on the JVM used by the application. For JVMs earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the second value applies.
6 Supported only for DB2 V9.5 and V9.7 for Linux/UNIX/Windows, DB2 V9.1 for z/OS, and DB2 for i V6R1.
7 When JDBCBehavior=0, the data type depends on the JVM used by the application. For JVMs earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the second value applies.
8 When JDBCBehavior=0, the data type depends on the JVM used by the application. For JVMs earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the second value applies.
9 Supported only for DB2 for z/OS and DB2 for i V5R2 and higher.
10 Supported only for DB2 V10.1 for Linux/UNIX/Windows.
11 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.
12 Supported only for DB2 V9.1 for z/OS.
13 When JDBCBehavior=0, the data type depends on the JVM used by the application. For JVMs earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the second value applies.
14 Supported only for DB2 V9.1 and higher for Linux/UNIX/Windows.
15 The XML DescribeType property overrides the mappings for XML data.
16 When JDBCBehavior=0, the data type depends on the JVM used by the application. For JVMs earlier than Java SE 6, the first value applies. For Java SE 6 and higher, the second value applies.