Task overview: IBM Optim pureQuery Runtime

IBM Optim pureQuery Runtime provides Java Persistence API (JPA) with an alternative way to access a database. IBM Optim pureQuery Runtime supports static Structured Query Language (SQL).

About this task

JPA in the Java EE and Java SE environments provides optional support for the IBM Optim pureQuery Runtime environment. IBM Optim pureQuery Runtime is a high performance Java data access platform that helps manage applications that access data. IBM Optim pureQuery Runtime provides an alternate set of APIs that can be used instead of Java Database Connectivity (JDBC) to access the DB2® and Informix® database.

To use this feature on the application server, you must install IBM Optim pureQuery Runtime version 1.2 or later. If you plan to perform the DB2 bind command from the administrative console, or with the wsadmin tool, you must have IBM Optim pureQuery Runtime v1.2 or later. Refer to the Data Studio information center topic on installing IBM Optim pureQuery Runtime for more information.

New or updated for this feature pack Using IBM Optim pureQuery Runtime dynamically is a new feature available with the Feature Pack for OSGi applications and JPA 2.0. The pdqxml file location is specified by the pdqProperties property on the data source or connection URL. For more information, see the topic, Using IBM Optim pureQuery Runtime in dynamic mode.

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. To create the packages, the user must first run the wsdbgen command on a JPA application. The wsdbgen command creates a persistence_unit_name.pdqxml file. This file contains pre-generated SQL statements for Create, Update, Delete, and Retrieve, NamedQueries and NamedNativeQueries of JPA entities. The persistence_unit_name.pdqxml file must be bound against database. Associated DB2 packages are generated and the SQL statement is executed statically at runtime. This persistence_unit_name.pdqxml file must be included into the application Java archive (JAR) file.

The application server offers support for static SQL for Enterprise JavaBeans (EJB) 2.x and later entity beans with the ejbdeploy SQLj option. With JPA, this feature is offered through IBM Optim pureQuery Runtime.

When doing the bind process and when you define your JDBC provider, the following four Java archive (JAR) files must be in the class path:
  • db2jcc_license_cisuz.jar
  • db2jcc_license_cu.jar
  • pdq.jar
  • pdqmgmt.jar
Attention: Read more about the DB2 JAR level compliance for IBM Optim pureQuery Runtime at the IBM® Support Web site: System requirements for IBM Optim pureQuery Runtime for Linux®, UNIX®, and Windows®.

WebSphere® Application Server support for IBM Optim pureQuery Runtime

Restriction:
  • There is no support for the QueryTimeout property specified through the FetchPlan API. The QueryTimeout value is ignored if specified.
  • OpenJPA large result processing uses JDBC APIs for scrollable cursors.
Important:
  • JPA sets the IBM Optim pureQuery Runtime property, pdq.executionMode, to the value STATIC.
  • In addition to the JDBC driver JAR file, the JDBC provider configuration must include the JAR file for the IBM Optim pureQuery Runtime environment.
  • OpenJPA provides support to allow application programs to programmatically access and alter the FetchPlan at run time. Altering the fetch plan might result in an SQL that has not been generated by the wsdbgen command at application build time. If this occurs, the SQL is executed dynamically rather than using static SQL from the database package.
  • If the user makes changes to the application queries, entity mapping or persistence properties, run the wsdbgen command and bind again. This process generates and binds the updated database packages.
  • Input parameter values in JPA queries (with both EJB SQL queries and native SQL queries) cannot be NULL values except in the case of update statements SET expression values. To search for NULL values in a WHERE clause of SELECT, UPDATE or DELETE, then enter the is null predicate instead.

Procedure




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: Jan 16, 2013 3:37:33 AM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v700osgijpa&product=was-nd-mp&topic=tejb_jpapdq
File name: tejb_jpapdq.html