IBM DB2 Manual page 422

Table of Contents

Advertisement

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406
Application Programming Guide and Reference for Java
specifying the COLLECTION option in the -bindoptions parameter. To execute a
package that is in a collection other than the collection that is specified in the
serialized profile, include a SET CURRENT PACKAGESET statement in the
program.
Using the VERSION parameter: Use the VERSION parameter to bind two or more
versions of a package for the same SQLJ program into the same collection. You
might do this if you have changed an SQLJ source program, and you want to run
the old and new versions of the program.
To maintain two versions of a package, follow these steps:
1. Change the code in your source program.
2. Translate the source program to create a new serialized profile. Ensure that you
do not overwrite your original serialized profile.
3. Run db2sqljcustomize to customize the serialized profile and create DB2
packages with the same package names and in the same collection as the
original packages. Do this by using the same values for -rootpkgname and
-collection when you bind the new packages that you used when you created
the original packages. Specify the VERSION option in the -bindoptions
parameter to put a version ID in the new customized serialized profile and in
the new packages.
It is essential that you specify the VERSION option when you perfom this step.
If you do not, you overwrite your original packages.
When you run the old version of the program, DB2 loads the old versions of the
packages. When you run the new version of the program, DB2 loads the new
versions of the packages.
Binding packages and plans on DB2 for z/OS: You can use the db2sqljcustomize
-genDBRM parameter to create DBRMs on your local system. You can then transfer
those DBRMs to a DB2 for z/OS system, and bind them into packages or plans
there. If you plan to use this technique, you need to transfer the DBRM files to the
z/OS system as binary files, to a partitioned data set with record format FB and
record length 80. When you bind the packages or plans, you need to specify the
following bind option values:
ENCODING(EBCDIC)
The IBM Data Server Driver for JDBC and SQLJ on DB2 for z/OS requires
EBCDIC encoding for your packages and plans.
DYNAMICRULES(BIND)
This option ensures consistent authorization rules when SQLJ uses
dynamic SQL. SQLJ uses dynamic SQL for positioned UPDATE or DELETE
operations that involve multiple SQLJ programs.
DBPROTOCOL(DRDA)
Private protocol is deprecated, so you should use DBPROTOCOL(DRDA)
for all applications. However, for SQLJ applications that use remote
three-part table names, you must use DBPROTOCOL(DRDA). Otherwise,
those applications might fail.
Related concepts
"Security for preparing SQLJ applications with the IBM Data Server Driver for
JDBC and SQLJ" on page 462
Related tasks
"Program preparation for SQLJ programs" on page 183
Related reference

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents