Use this task to configure the application data source Java Database Connectivity (JDBC)
provider to use pureQuery to access DB2® in
a Java Standard Edition (Java SE) environment.
Before you begin
If you need to use multiple DB2 package
collections, see the information center topic, Configure pureQuery
to use multiple package collections, before continuing with this task.
About 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.
You 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 Java archive (JAR)
file. The DB2 bind command uses
this file as input to create the DB2 package.
Important:
- JPA sets the IBM Optim PureQuery Runtime property pdq.executionMode to
the value STATIC.
- The class path must include the installation location for the IBM Optim PureQuery
Runtime. See the information center topic on installing IBM Optim PureQuery
Runtime for more information.
- The JPA provider implementation must be JPA for the application
server (com.ibm.websphere.persistence.PersistenceProviderImpl).
The OpenJPA persistence provider does not provide support for pureQuery.
- The wsdbgen command requires the URL of a database. The wsdbgen
command forces a synchronize mapping function that creates or alters
the required tables. For DB2 zOS,
V8 unique indexes and LOB tables must be manually created prior to
executing the wsdbgen command.
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. You 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.
- wsjpa.jdbc.CollectionId: String value specifying
the collection ID to use. This parameter overrides any collection
ID that is used during wsdbgen.
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.
What to do next
If you want to reconfigure the data source for JDBC, remove
the
pdq.jar and
pdqmgmt.jar from the class path.