Configuration of DB2 for z/OS servers for client reroute ...................85
Enabling IBM Data Server Driver for JDBC and SQLJ client reroute for connections to DB2 servers .....85
Enabling IBM Data Server Driver for JDBC and SQLJ client reroute for connections to IDS servers .....87
IBM Data Server Driver for JDBC and SQLJ client reroute support with JNDI ............89
IBM Data Server Driver for JDBC and SQLJ client reroute operation ...............90
IBM Data Server Driver for JDBC and SQLJ support for client affinities for cascaded failover .......95
Failover support with IBM Data Server Driver for JDBC and SQLJ type 2 connectivity on DB2 for z/OS ....97
Memory use for IBM Data Server Driver for IBM Data Server Driver for JDBC and SQLJ type 2 connectivity on
DB2 for z/OS...................................98
Disconnecting from data sources in JDBC applications .....................99
Chapter 4. SQLJ application programming ....................101
Example of a simple SQLJ application ..........................101
Connecting to a data source using SQLJ .........................103
SQLJ connection technique 1: JDBC DriverManager interface .................104
SQLJ connection technique 2: JDBC DriverManager interface .................105
SQLJ connection technique 3: JDBC DataSource interface ...................107
SQLJ connection technique 4: JDBC DataSource interface ...................108
SQLJ connection technique 5: Use a previously created connection context .............109
SQLJ connection technique 6: Use the default connection ...................109
Java packages for SQLJ support ............................110
Variables in SQLJ applications .............................110
Comments in an SQLJ application ...........................112
SQL statement execution in SQLJ applications .......................112
Creating and modifying DB2 objects in an SQLJ application ..................113
Performing positioned UPDATE and DELETE operations in an SQLJ application ...........114
Data retrieval in SQLJ applications ..........................123
Calling stored procedures in an SQLJ application .....................134
LOBs in SQLJ applications with the IBM Data Server Driver for JDBC and SQLJ ...........136
SQLJ and JDBC in the same application ........................139
Controlling the execution of SQL statements in SQLJ ....................142
ROWIDs in SQLJ with the IBM Data Server Driver for JDBC and SQLJ ..............143
Distinct types in SQLJ applications ..........................144
Savepoints in SQLJ applications ...........................145
XML data in SQLJ applications ............................145
XML column updates in SQLJ applications .......................146
XML data retrieval in SQLJ applications ........................148
XMLCAST in SQLJ applications ...........................150
SQLJ utilization of SDK for Java Version 5 function......................150
Transaction control in SQLJ applications .........................153
Setting the isolation level for an SQLJ transaction .....................153
Committing or rolling back SQLJ transactions ......................153
Handling SQL errors and warnings in SQLJ applications ....................154
Handling SQL errors in an SQLJ application .......................154
Handling SQL warnings in an SQLJ application ......................155
Closing the connection to a data source in an SQLJ application ..................156
Chapter 5. Java stored procedures and user-defined functions ...........157
Setting up the environment for Java routines ........................157
Setting up the WLM application environment for Java routines.................158
Run-time environment for Java routines ........................160
Defining Java routines and JAR files to DB2 ........................164
Definition of a Java routine to DB2 ..........................164
Definition of a JAR file for a Java routine to DB2 .....................168
Java routine programming ..............................175
Differences between Java routines and stand-alone Java programs ................176
Differences between Java routines and other routines ....................176
Static and non-final variables in a Java routine ......................177
Writing a Java stored procedure to return result sets ....................178
Techniques for testing a Java routine ..........................179
iv Application Programming Guide and Reference for Java
™
||
||
||
||
||