Network Deployment (Distributed operating systems), v8.0 > Administer applications and their environment > Administer EJB applications > Administer applications that use the Java Persistence API > Configure JPA to work in the environment > Configure a JDBC provider and data source


Configure data source JDBC providers to use pureQuery in a Java SE environment

Use this task to configure the application data source JDBC provider to use pureQuery to access DB2 in a Java Standard Edition (Java SE) environment. If use multiple DB2 package collections, see the information center topic, Configure pureQuery to use multiple package collections, before continuing with this task.

IBM Optim PureQuery Runtime makes use of DB2 packages. These packages include information for one or more Structured Query Language (SQL) statements and are stored in the DB2 catalog. We must first run the wsdbgen command on a Java Persistence API (JPA) application to create the packages. The wsdbgen command creates an XML file containing SQL statement information. This XML file must be included into the application JAR file. The DB2 bind command uses this file as input to create the DB2 package.

IBM Optim PureQuery Runtime properties are specified in a pdq.properties file in the META-INF directory of the application JAR file. The pdq.ExecutionMode property is defaulted to STATIC for JPA applications. We can use the pdqProperties property to use pureQuery in DYNAMIC mode. See the information center topic, Using pureQuery in dynamic mode, for more information. PDQ properties, if specified, pass on to the IBM Optim PureQuery Runtime. See the IBM Optim PureQuery Runtime documentation for list of properties and valid values.

Attention: Read more about the DB2 JAR level compliance for IBM Optim PureQuery Runtime at the IBM Support website: System requirements for IBM Optim PureQuery Runtime for Linux, UNIX, and Windows.


Procedure

  1. Update the application data source JDBC provider configuration to include the IBM Optim PureQuery Runtime JAR files. Include the pdq.jar and pdqmgmt.jar files on the class path in addition to the JDBC driver jar files. Either define a new JDBC provider or modify an existing provider to include the JAR files. The class path must include the installation location for the IBM Optim PureQuery Runtime. See the information center topics on JDBC provider settings and installing IBM Optim PureQuery Runtime for more information.

  2. Use the DB2 bind command provided by IBM Optim PureQuery Runtime, bind the XML file to the database. This creates the DB2 packages. Refer to the information center topic on the pureQuery Bind utility for more information.


What to do next

To reconfigure the data source for JDBC, remove the pdq.jar and pdqmgmt.jar from the class path.


Related


Configure pureQuery to use multiple DB2 package collections
Task overview: IBM Optim pureQuery Runtime
Configure a JDBC provider
Use pureQuery in dynamic versus static mode for DB2 and Informix


Related


wsenhancer command
wsdbgen command
JDBC provider settings
SQLJ profiles and pureQuery bind files settings
Application management command group
System requirements for IBM Optim pureQuery Run time for Linux, UNIX, and Windows

+

Search Tips   |   Advanced Search