EasyManuals Logo

IBM DB2 User Manual

IBM DB2
585 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #212 background imageLoading...
Page #212 background image
Table 26. Mappings of database server data types to Java data types for retrieving data from database server
tables (continued)
SQL data type
Recommended Java data type or
Java object type Other supported Java data types
DBCLOB(m) No exact equivalent. Use
java.sql.Clob.
ROWID java.sql.RowId byte[], com.ibm.db2.jcc.DB2RowID
(deprecated)
XML
4
java.sql.SQLXML byte[], java.lang.String,
java.io.InputStream, java.io.Reader
DATE java.sql.Date java.sql.String, java.sql.Timestamp
TIME java.sql.Time java.sql.String, java.sql.Timestamp
TIMESTAMP java.sql.Timestamp java.sql.String, java.sql.Date,
java.sql.Time, java.sql.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.
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.
Table 27. Mappings of Java, JDBC, and SQL data types for calling stored procedures and user-defined functions
Java data type JDBC data type SQL data type
1
boolean
2
BIT SMALLINT
byte
2
TINYINT SMALLINT
short, java.lang.Short SMALLINT SMALLINT
int, java.lang.Integer INTEGER INTEGER
long BIGINT BIGINT
6
float, java.lang.Float REAL REAL
float, java.lang.Float FLOAT REAL
double, java.lang.Double DOUBLE DOUBLE
196 Application Programming Guide and Reference for Java
â„¢
|
|
|
|
|
|

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM DB2 and is the answer not in the manual?

IBM DB2 Specifications

General IconGeneral
DeveloperIBM
Initial Release1983
LicenseProprietary
Written inC, C++
CategoryDatabase Management System (RDBMS)
Operating SystemLinux, Windows
Programming LanguagesC, C++
Data ModelsRelational
EditionsCommunity, Standard, Advanced
Key Featureshigh availability, scalability