Set to use pureQuery in a Java EE environment
Use this task to configure the application data source JDBC provider to use pureQuery to access DB2. to use multiple DB2 package collections, see the information center topic: "Configuring pureQuery to use multiple package collections".
PureQuery makes use of DB2 packages. These packages consist of information for one or more SQL statements and are stored in the DB2 catalog.
First run the wsdb2gen command on a JPA application to create the packages. The wsdb2gen 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.
- JPA sets the pureQuery property pdq.executionMode to the value STATIC.
- The JDBC provider configuration must include the JAR file for the pureQuery runtime environment. This JAR file is in addition to the JDBC driver JAR file.
- If this is an XA data source, define a new custom property on the data source where property_name = downgradeHoldCursorsUnderXa and boolean value = true.
- Update the application data source JDBC provider configuration to include the pureQuery runtime JAR file.
Either define an new JDBC provider or modify an existing provider to include the following JAR files. See information center topics on JDBC provider settings and installing pureQuery Runtime for more information.
- Use 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 for more information.
- Use the admin console.
Refer to the information center topic on SQLj profiles and pureQuery bind files settings for more information.
- Use the DB2 bind command provided by Data Studio.
Refer to the information center topic on the pureQuery Bind utility for more information.
Next steps
data source for JDBC, just remove the pdq.jar and pdqmgmt.jar from the class path.
Related tasks
Set pureQuery to use multiple package collections
Task overview: Data Studio pureQuery
Set a JDBC provider
Related
wsenhancer
wsdb2gen
JDBC provider settings
SQLj profiles and pureQuery bind files settings
Application management