IBM DB2 Manual page 202

Table of Contents

Advertisement

An existing SQLJ application was customized and bound using the following
db2sqljcustomize invocation:
db2sqljcustomize -url jdbc:db2://system1.svl.ibm.com:8000/ZOS1
In addition to accessing data at the location that is indicated by URL
jdbc:db2://system1.svl.ibm.com:8000/ZOS1, you want to use the application to
access data at the location that is indicated by jdbc:db2://
system2.svl.ibm.com:8000/ZOS2. On the ZOS2 system, DB2 objects have a qualifier
of WRK2, and the packages need to be in collection MYCOL2. You therefore need
to bind packages at location ZOS2, change the default qualifier to WRK2, and
specify the MYCOL2 collection for the packages. Use one of the following methods
to bind the packages:
v Run DB2 BIND with COPY to copy each of the packages (one for each isolation
v Run the db2sqljbind command to create DB2 packages on ZOS2 from the
After you bind the packages, you need to ensure that when the application runs,
the DB2 database server at ZOS2 can find the packages. The collection ID in the
serialized profile is MYCOL1, so the DB2 database server looks in MYCOL1 for the
packages. When you run the application against the ZOS2 system, you need to
access packages in MYCOL2.
For applications that use IBM Data Server Driver for JDBC and SQLJ type 2
connectivity, use one of the following methods to tell the database server to look in
MYCOL2 as well as MYCOL1:
v Specify "MYCOL1.*,MYCOL2.*" in the pkList DataSource property:
v Bind a plan for the application that includes the packages in MYCOL2 and the
For applications that use IBM Data Server Driver for JDBC and SQLJ type 4
connectivity, specify "MYCOL1.*,MYCOL2.*" in the currentPackagePath DataSource
property.
186
Application Programming Guide and Reference for Java
-user user01 -password mypass
-rootPkgName WRKSQLJ
-qualifier WRK1
-collection MYCOL1
-bindoptions "CURRENTDATA NO QUALIFIER WRK1 "
-staticpositioned YES WrkTraceTest_SJProfile0.ser
level) from the ZOS1 system to the ZOS2 system:
BIND PACKAGE (ZOS2.MYCOL2) OWNER(USER01) QUALIFIER(WRK2) -
COPY(MYCOL.WRKSQLJ1) CURRENTDATA(NO)
BIND PACKAGE (ZOS2.MYCOL2) OWNER(USER01) QUALIFIER(WRK2) -
COPY(MYCOL.WRKSQLJ2) CURRENTDATA(NO)
BIND PACKAGE (ZOS2.MYCOL2) OWNER(USER01) QUALIFIER(WRK2) -
COPY(MYCOL.WRKSQLJ3) CURRENTDATA(NO)
BIND PACKAGE (ZOS2.MYCOL2) OWNER(USER01) QUALIFIER(WRK2) -
COPY(MYCOL.WRKSQLJ4) CURRENTDATA(NO)
serialized profile on ZOS1:
db2sqljbind -url jdbc:db2://system2.svl.ibm.com:8000/ZOS2
-user user01 -password mypass
-bindoptions "COLLECTION MYCOL2 QUALIFIER WRK2"
-staticpositioned YES WrkTraceTest_SJProfile0.ser
pkList = MYCOL1.*,MYCOL2.*
IBM Data Server Driver for JDBC and SQLJ packages:
BIND PLAN(WRKSQLJ) PKLIST(MYCOL1.*,MYCOL2.*,JDBCCOL.*)
Then specify WRKSQLJ in the planName DataSource property:
planName = WRKSQLJ

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents