IBM DB2 Manual page 212

Table of Contents

Advertisement

Table 26. Mappings of database server data types to Java data types for retrieving data from database server
tables (continued)
SQL data type
DBCLOB(m)
ROWID
4
XML
DATE
TIME
TIMESTAMP
Notes:
1. n=16 or n=34.
|
2. 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.
3. This mapping is valid only if the database server can determine the data type of the column.
4. 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.
|
5. 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.
|
6. 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, and DB2 for i5/OS V5R3 or later database servers.
Table 27. Mappings of Java, JDBC, and SQL data types for calling stored procedures and user-defined functions
Java data type
2
boolean
2
byte
short, java.lang.Short
int, java.lang.Integer
long
float, java.lang.Float
float, java.lang.Float
double, java.lang.Double
196
Application Programming Guide and Reference for Java
Recommended Java data type or
Java object type
No exact equivalent. Use
java.sql.Clob.
java.sql.RowId
java.sql.SQLXML
java.sql.Date
java.sql.Time
java.sql.Timestamp
Data types for calling stored procedures and user-defined
functions
The following table summarizes mappings of Java data types to JDBC data types
and DB2 or IDS data types for calling user-defined function and stored procedure
parameters. The mappings of Java data types to JDBC data types are for
CallableStatement.registerOutParameter methods in JDBC programs. The
mappings of Java data types to database server data types are for parameters in
stored procedure or user-defined function invocations.
If more than one Java data type is listed in the following table, the first data type
is the recommended data type.
JDBC data type
BIT
TINYINT
SMALLINT
INTEGER
BIGINT
REAL
FLOAT
DOUBLE
Other supported Java data types
byte[], com.ibm.db2.jcc.DB2RowID
(deprecated)
byte[], java.lang.String,
java.io.InputStream, java.io.Reader
java.sql.String, java.sql.Timestamp
java.sql.String, java.sql.Timestamp
java.sql.String, java.sql.Date,
java.sql.Time, java.sql.Timestamp
1
SQL data type
SMALLINT
SMALLINT
SMALLINT
INTEGER
6
BIGINT
REAL
REAL
DOUBLE

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents