In a simple example, you use the
four steps, (capture, configure, bind, and execute) to enable a Java application with pureQuery
client optimization and configure the application to run SQL statements
statically on a DB2® database.
- Capture SQL data.
- Configure the captured SQL with characteristics of the DB2 packages that will be created
for the SQL statements.
- Create packages from the SQL statements and bind the packages
to a DB2 database.
- Execute the SQL statements statically.
About this task
The example assumes that the application is a stand-alone
JDBC-based application that uses a DB2 database
as the data source, and that you are performing the tasks in the directory
that contains the application. The SQL data that is captured by pureQuery
Runtime is stored on the local file system in a pureQueryXML file.
The following illustration shows the configuration.
Figure 1. pureQuery client optimization configuration
In the illustration, the pureQuery Configure utility converts
the pureQueryXML file that contains the captured SQL data file into
a configured pureQueryXML file.
When you enable pureQuery client
optimization and execute SQL statements statically, you use the following
pureQuery capabilities:
- You set pureQuery Runtime properties to first capture SQL statements
and then to execute SQL statements statically.
- You use the pureQuery utilities Configure and StaticBinder with
the SQL statements that you capture from the application.
What to do next
In a more complex application scenario, you can capture
SQL statements from the application in multiple iterations. When you
capture SQL data in multiple iterations, you perform the additional
step of merging the captured SQL data with the configured pureQueryXML
file prior to configuring and binding the SQL statements.
The
Configure and StaticBinder utilities support an options file where
all the deployment information can be listed with various options
that are applicable for the packages. After you create an options
file, you can invoke the utility with the option -optionsFile to
specify the file.
You can also create a shell script that contains
utility commands to repeat and automate the four-step process. If
the pureQuery JAR files are in the CLASSPATH, all of the utilities
are available as Java programs.
In IBM® Optim™ Development Studio, you can enable
a Java project with pureQuery
support and develop Java applications
that are enabled with pureQuery client optimization in the Eclipse
IDE.