IBM DB2 Manual page 214

Table of Contents

Advertisement

Table 27. Mappings of Java, JDBC, and SQL data types for calling stored procedures and user-defined
functions (continued)
Java data type
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.
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
1
FUNCTION
SMALLINT
INTEGER
4
BIGINT
REAL
DOUBLE
DECIMAL
3
DECFLOAT
CHAR
VARCHAR
CHAR FOR BIT DATA
VARCHAR FOR BIT DATA
4
BINARY
4
VARBINARY
198
Application Programming Guide and Reference for Java
JDBC data type
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.
Data type in Java stored procedure or
user-defined function method
short, java.lang.Integer
int, java.lang.Integer
long, java.lang.Long
float, java.lang.Float
double, java.lang.Double
java.math.BigDecimal
java.math.BigDecimal
java.lang.String
java.lang.String
byte[]
byte[]
byte[]
byte[]
1
SQL data type
2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents