After you install pureQuery Runtime,
you need to configure WebSphere® Application
Server with the location of the pureQuery JAR files, so that you can
use pureQuery client optimization with a WebSphere application.
Before you begin
The scenario assumes the following configuration:
- A WebSphere Application
Server is installed and a JDBC Provider is defined for the IBM® Data Server Driver for JDBC
and SQLJ.
A simple Web application named TestStaticProfileEAR is
running in the WebSphere Application
Server.
- pureQuery Runtime is installed in a location that is accessible
to the WebSphere Application
Server.
The pureQuery Runtime files are installed in the directory C:\PureQueryRuntime and
the installation process created the environment variable PDQ_JAR_PATH.
For
information about installing pureQuery Runtime, see Installing Optim™ pureQuery
Runtime for Linux, UNIX, and Windows.
About this task
To make the pureQuery Runtime JAR files available to the WebSphere Application Server
class loaders, you install pureQuery Runtime on the WebSphere system. In the WebSphere environment, you place the pureQuery
JAR files pdq.jar and pdqmgmt.jar in the DB2® Universal
Driver Provider CLASSPATH. The following steps are performed from
the administrative console for WebSphere Application Server
Version 6.1.
This task is for a simple Web application with
one WEB module running under a WebSphere Application
Server. You use a similar set of steps for applications consisting
of multiple modules including EJB modules.
Procedure
To enable pureQuery Runtime with WebSphere Application Server:
- Add the pureQuery JAR files pdq.jar and pdqmgmt.jar in
the DB2 Universal Driver Provider
CLASSPATH.
Perform the following steps from the administrative console:
- Create a WebSphere environment
variable to point to the file system path of the pureQuery Runtime
JAR files.
Select .
Table 1. WebSphere environment variable
for pureQuery RuntimeWebSphere environment
variable |
Value |
PDQ_JAR_PATH |
C:\PureQueryRuntime |
- Add the location of the pureQuery Runtime JAR files
to the CLASSPATH of the DB2 Universal
Driver JDBC provider.
Select . In the General Properties panel,
add paths to the pureQuery Runtime JAR files after the driver JAR
files in the Class path pane.
The classpath
contains both the DB2 JDBC JAR
files and the pureQuery Runtime JAR files:
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar
${PDQ_JAR_PATH}/pdq.jar
${PDQ_JAR_PATH}/pdqmgmt.jar
Important: The
pureQuery Runtime JAR files must be in the same CLASSPATH as the JDBC
provider path. pureQuery Runtime works with the JDBC driver. The class
loader that loads the JDBC driver JAR files must also load the pureQuery
Runtime JAR files. pureQuery Runtime will not work correctly if the
path to the pureQuery Runtime JAR files is in a different CLASSPATH.
- Save the WebSphere settings
after you make the changes.
- Verify that the JAR files are placed correctly.
Select in the administrative
console. The pureQuery Runtime JAR files appear in the list of
files that is similar to the following list:
. . .
file:/C:/SQLLIB/java/db2jcc.jar
file:C:/SQLLIB/java/db2jcc_license_cisuz.jar
file:/C:/PureQueryRuntime/pdq.jar
file:/C:/PureQueryRuntime/pdqmgmt.jar
. . .
- Verify that the pureQuery Runtime is installed correctly
in the WebSphere environment
by running the pureQuery DataVersion utility.
From a
command window, run a command similar to the following command:
java -cp "C:/PureQueryRuntime/pdq.jar; C:/PureQueryRuntime/pdqmgmt.jar;
C:/SQLLIB/java/db2jcc.jar; C:/SQLLIB/java/db2jcc_license_cisuz.jar"
com.ibm.pdq.tools.DataVersion -configuration -url url -username <user> -password pass
In
the -cp option of the command, replace the path C:/PureQueryRuntime with
the path you defined for the WebSphere environment
variable ${PDQ_JAR_PATH} and replace the path C:/SQLLIB/java with
the path defined for the WebSphere environment
variable {UNIVERSAL_JDBC_DRIVER_PATH}. You can also create shell environment
variables that are set to the appropriate values. These variables
point to the location of the pureQuery Runtime JAR files and the IBM Data Server Driver for JDBC
and SQLJ JAR files.
The following text is
sample output from the pureQuery DataVersion utility:
pureQuery Features:
pureQuery Base Function: Activated
pureQuery runtime: Activated
Extended Insight Monitor Server: Activated
Global pureQuery properties in effect
Note: These be overridden by connection-specific settings:
pdq.allowDynamicSQL=true
pdq.captureMode=OFF
pdq.captureStatementBatchSQL=ON
pdq.capturedOnly=false
pdq.cmx.controllerDiscoveryInterval=-1
pdq.cmx.controllerDiscoveryPort=50000
pdq.cmx.controllerURL=
pdq.cmx.dataSourceLookupInterval=20
pdq.cmx.multicastTimeToLive=10
pdq.enableDynamicSQLReplacement=false
pdq.executionMode=DYNAMIC
pdq.maxNonParmSQL=-1
pdq.maxResultRows=
pdq.maxStackTracesCaptured=5
pdq.outputPureQueryXml=
pdq.packagePrefixExclusions=
pdq.pureQueryXml=
pdq.queryTimeoutInSeconds=
pdq.sqlLiteralSubstitution=NOT_SET
pdq.stackTraceDepth=10
pdq.traceFile=pdq.log
pdq.traceLevel=OFF
...
- Restart the application server.
Results
With the change to the CLASSPATH setting in WebSphere, pureQuery client optimization
is enabled for Web applications that use the DB2 Universal Driver Provider.