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 #214 background imageLoading...
Page #214 background image
Table 27. Mappings of Java, JDBC, and SQL data types for calling stored procedures and user-defined
functions (continued)
Java data type JDBC data type SQL data type
1
Notes:
1. A DB2 for z/OS stored procedure or user-defined function parameter cannot have the XML data type.
2. A stored procedure or user-defined function that is defined with a SMALLINT parameter can be invoked with a
boolean or byte parameter. However, this is not recommended.
3. DECFLOAT parameters in Java routines are valid only for connections to DB2 Version 9.1 for z/OS or later
database servers. DECFLOAT parameters in Java routines are not supported for connections to for Linux, UNIX,
and Windows or DB2 for i. Use of DECFLOAT requires the SDK for Java Version 5 (1.5) or later.
4. This mapping is valid only if the database server can determine the data type of the column.
5. 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 and later database
servers.
6. 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.
Data types in Java stored procedures and user-defined functions
The following table summarizes mappings of the SQL parameter data types in a
CREATE PROCEDURE or CREATE FUNCTION statement to the data types in the
corresponding Java stored procedure or user-defined function method.
For DB2 Database for Linux, UNIX, and Windows, if more than one Java data type
is listed for an SQL data type, only the first Java data type is valid.
For DB2 for z/OS, if more than one Java data type is listed, and you use a data
type other than the first data type as a method parameter, you need to include a
method signature in the EXTERNAL clause of your CREATE PROCEDURE or
CREATE FUNCTION statement that specifies the Java data types of the method
parameters.
Table 28. Mappings of SQL data types in a CREATE PROCEDURE or CREATE FUNCTION statement to data types in
the corresponding Java stored procedure or user-defined function program
SQL data type in CREATE PROCEDURE or CREATE
FUNCTION
1
Data type in Java stored procedure or
user-defined function method
2
SMALLINT short, java.lang.Integer
INTEGER int, java.lang.Integer
BIGINT
4
long, java.lang.Long
REAL float, java.lang.Float
DOUBLE double, java.lang.Double
DECIMAL java.math.BigDecimal
DECFLOAT
3
java.math.BigDecimal
CHAR java.lang.String
VARCHAR java.lang.String
CHAR FOR BIT DATA byte[]
VARCHAR FOR BIT DATA byte[]
BINARY
4
byte[]
VARBINARY
4
byte[]
198 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