IBM DB2 Manual page 210

Table of Contents

Advertisement

Table 25. Mappings of Java data types to database server data types for updating database tables (continued)
Java data type
java.sql.Blob
java.sql.Blob
java.sql.Clob
java.sql.Clob
java.sql.Clob
java.sql.Date
java.sql.Time
java.sql.Timestamp
java.io.ByteArrayInputStream
java.io.StringReader
java.io.ByteArrayInputStream
java.io.InputStream
com.ibm.db2.jcc.DB2RowID (deprecated)
java.sql.RowId
com.ibm.db2.jcc.DB2Xml (deprecated)
java.sql.SQLXML
Notes:
1. The database server has no exact equivalent for the Java boolean or byte data types, but the best fit is
SMALLINT.
2. p is the decimal precision and s is the scale of the table column.
You should design financial applications so that java.math.BigDecimal columns map to DECIMAL columns. If
you know the precision and scale of a DECIMAL column, updating data in the DECIMAL column with data in a
java.math.BigDecimal variable results in better performance than using other combinations of data types.
3. n=16 or n=34.
|
4. DECFLOAT is valid for connections to DB2 Version 9.1 for z/OS, DB2 V9.5 for Linux, UNIX, and Windows, or
|
DB2 for i V6R1, or later database servers. Use of DECFLOAT requires the SDK for Java Version 5 (1.5) or later.
5. n<=255.
6. m<=127.
7. n<=32704.
8. m<=16352.
9. This mapping is valid only if the database server can determine the data type of the column.
10. XML is valid for connections to DB2 Version 9.1 for z/OS or later database servers or DB2 V9.1 for Linux, UNIX,
and Windows or later database servers.
|
11. BIGINT is valid for connections to DB2 Version 9.1 for z/OS or later database servers, DB2 V9.1 for Linux,
|
UNIX, and Windows or later database servers, and all supported DB2 for i database servers.
|
12. BINARY and VARBINARY are valid for connections to DB2 Version 9.1 for z/OS or later database servers, DB2
|
V9.1 for Linux, UNIX, and Windows or later database servers, or DB2 for i5/OS V5R3 and later database
|
servers.
194
Application Programming Guide and Reference for Java
Data types for retrieval from table columns
The following table summarizes the mappings of DB2 or IDS data types to Java
data types for ResultSet.getXXX methods in JDBC programs, and for iterators in
SQLJ programs. This table does not list Java numeric wrapper object types, which
are retrieved using ResultSet.getObject.
Database data type
BLOB
10
XML
CLOB
9
DBCLOB
10
XML
DATE
TIME
TIMESTAMP
BLOB
CLOB
CLOB
10
XML
ROWID
ROWID
10
XML
10
XML

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents