Configuring JDBC providers to use IBM Optim pureQuery Runtime to access DB2

Use this task to configure the application data source Java Database Connectivity (JDBC) provider to use IBM Optim pureQuery Runtime to access DB2® in a Java EE environment.

Before you begin

If you need to use multiple DB2 package collections, see the documentation about configuring pureQuery to use multiple package collections, before continuing with this task.

New or updated for this feature pack The Feature Pack for OSGi Applications and JPA 2.0 introduces support for Apache OpenJPA 2.0.

About this task

IBM Optim pureQuery Runtime makes use of DB2 packages. These packages consist of information for one or more SQL statements and are stored in the DB2 catalog. You must first run the wsdbgen command on a 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 Java archive (JAR) file. The DB2 bind command uses this file as input to create the DB2 package.

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.
New or updated for this feature pack For JPA 2.0, the wsdbgen command creates the XML file that contains the SQL statement information.
Important:
  • JPA sets the pureQuery property pdq.executionMode to the value STATIC.
    If the persistence.xml file specifies the following property:
    <property name="pdqProperties" value="dynamic"/>
    then the pureQuery property, pdq.executionMode, is set to DYNAMIC. For more information, see the documentation about using IBM Optim pureQuery Runtime in dynamic mode.
  • The JDBC provider configuration must include the JAR file for the IBM Optim pureQuery Runtime environment. This JAR file is in addition to the JDBC driver JAR file. For more information, see the documentation about installing IBM Optim pureQuery Runtime.
  • If this is an XA data source, define a new custom property on the data source where property_name = downgradeHoldCursorsUnderXa and boolean value = true.

Procedure

  1. Update the application data source JDBC provider configuration to include the IBM Optim pureQuery Runtime JAR file. Either define an new JDBC provider or modify an existing provider to include the following JAR files. For more information, see the documentation about the JDBC provider settings and installing IBM Optim pureQuery Runtime.
    • pdq.jar
    • pdqmgmt.jar
  2. Using the DB2 bind command, bind the XML file to the database. This creates the DB2 packages. There are three ways to do this:
    • Use the wsadmin command. Refer to the information center topic on application management command group for the AdminTask object for more information.
    • Using the administrative console. Refer to the information center topic on SQLj profiles and pureQuery bind files settings for more information.
    • Using the DB2 bind command provided by Data Studio. Refer to the information center topic on the pureQuery Bind utility for more information.

What to do next

If you want to reconfigure the data source for JDBC, just remove the pdq.jar and pdqmgmt.jar from the class path.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Jun 12, 2013 3:32:32 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v700osgijpa&product=was-nd-mp&topic=tejb_configpdq
File name: tejb_configpdq.html