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 7
Timestamp with Time Zone 8 VARCHAR or TIMESTAMP 9
Varbinary VARBINARY
Varchar VARCHAR
Varchar for Bit Data VARBINARY
Vargraphic VARCHAR or NVARCHAR 10
XML11,12 CLOB or SQLXML 13

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 By default, the driver reports the data type as VARCHAR (type code 12) and sets scale/DECIMAL_DIGITS to 0 in all metadata APIs (DatabaseMetaData, ParameterMetaData, and ResultSetMetaData) when the scale exceeds 9. For scales of 9 or less, the driver reports the data type as TIMESTAMP (type code 93). In each case, the returned values retain their full precision. This default behavior may be modified with the TimestampScaleGT9Behavior connection property. See TimestampScaleGT9Behavior for details.
8 Supported only for Db2 for z/OS.
9 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 When JDBCBehavior=1, the first value applies and when JDBCBehavior=0, the second value applies.
11 Supported only for Db2 for Linux/UNIX/Windows and Db2 for i V7R1 and higher.
12 The XML DescribeType property overrides the mappings for XML data.
13 When JDBCBehavior=1, the first value applies and when JDBCBehavior=0, the second value applies.