IBM Support

Tech Tip: How to specify REOPT option for JDBC applications using IBM DB2 JCC driver.

Technical Blog Post


Abstract

Tech Tip: How to specify REOPT option for JDBC applications using IBM DB2 JCC driver.

Body

 

The packages for IBM DB2 JCC driver can be bound using the db2binder tool by specifying a different collectionID of the packages bound with REOPT.

Here is more information on the tool:
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0023708.html
***********************************************
-collection
Specifies the collection ID for IBM Data Server Driver for JDBC and SQLJ or user packages. The default is NULLID. DB2Binder translates this value to uppercase.
You can create multiple instances of the IBM Data Server Driver for JDBC and SQLJ packages on a single data server by running com.ibm.db2.jcc.DB2Binder multiple times, and specifying a different value for -collection each time. At run time, you select a copy of the IBM Data Server Driver for JDBC and SQLJ by setting the currentPackageSet property to a value that matches a -collection value.

***********************************************
Example:
java com.ibm.db2.jcc.DB2Binder -url jdbc:db2//<server>:<port>:<database name> -user <userID> -password <password> -collection <collection name> -reopt <option>

After binding the packages, currentPackageSet  property should be used in the application to access those packages bound with that collection ID.

Here is more information about the currentPackageSet property:

http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052607.html
 
***********************************************
currentPackageSet
    Specifies the collection ID to search for JDBC and SQLJ packages.The data type of this property is String. The default is NULLID. If currentPackageSet is set, its value overrides the value of
jdbcCollection.
 
    Multiple instances of the IBM Data Server Driver for JDBC and SQLJ can be installed at a database server by running the DB2Binder utility multiple times. The DB2binder utility includes a -collection option that
lets the installer specify the collection ID for each IBM Data Server driver for JDBC and SQLJ instance. To choose an instance of the IBM Data Server Driver for JDBC and SQLJ for a connection, you specify a
currentPackageSet value that matches the collection ID for one of the IBM Data Server Driver for JDBC and SQLJ instances.
************************************************

 

[{"Business Unit":{"code":"BU029","label":"Data and AI"}, "Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]

UID

ibm13287031