16.10.2015 Views

Getting Startedwith pureQuery

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

122<br />

<strong>Getting</strong> Started with <strong>pureQuery</strong><br />

6.6.6 In practice: Configure the <strong>pureQuery</strong>Xml file that was captured<br />

Let’s now configure the <strong>pureQuery</strong>Xml file that we captured in Section 6.5.2. We start by<br />

adding the necessary options to the file in the project. The only option that we will specify<br />

is -rootPkgName, with the value HRMCO (for “Human Resources Manager,” and “Client<br />

Optimizer”). Locate the Default.genProps file in the directory <strong>pureQuery</strong>Folder and<br />

add the line shown in Listing 6.5. Make sure to give the correct path for the <strong>pureQuery</strong>Xml<br />

file, and to put the entire entry on a single line.<br />

C:\pathOfWorkspace\<strong>Getting</strong>StartedWithPureQuery\<strong>pureQuery</strong>Folder\captureFile.pdqxml=rootPkgName<br />

HRMCO<br />

Listing 6.5 - A line in Default.genProps that specifies the root package name for<br />

the <strong>pureQuery</strong>Xml file<br />

If you are using IBM Optim Development Studio, you have done all that you need to do; the<br />

tool will run the Configure utility automatically. If the error that occurred before you<br />

specified the root package name is still on the console, clear the console. If it appears<br />

again, check the contents of Default.genProps. You might not have added the root<br />

package name correctly.<br />

If you are not using IBM Optim Development Studio, you need to run the Configure utility<br />

on the command line. On the command line, specify the command in Listing 6.6. Make<br />

sure that pdq.jar and pdqmgmt.jar are in the classpath, and that you provide the<br />

correct path for Default.genProps.<br />

java com.ibm.pdq.tools.Configure -optionsFile<br />

"C:\pathOfWorkspace\<strong>Getting</strong>StartedWithPureQuery\<strong>pureQuery</strong>Folder\Default.genProps"<br />

Listing 6.6 - The command for configuring our <strong>pureQuery</strong>Xml file from the command<br />

line<br />

6.7 Binding the SQL statements in the <strong>pureQuery</strong>Xml file<br />

If you want to use static SQL, you must use the <strong>pureQuery</strong> StaticBinder utility to bind the<br />

SQL statements in your <strong>pureQuery</strong>Xml file. The StaticBinder utility binds packages in the<br />

database that correspond to the statement sets in the <strong>pureQuery</strong>Xml file. As described in<br />

Section 9.6.2.1, the utility only binds packages and statement sets for which the<br />

isBindable attributes are set to the value true. You can run the StaticBinder utility<br />

either from the command line or by selecting menu options in IBM Optim Development<br />

Studio. Refer to Chapter 7 for a description of the StaticBinder utility and how to specify<br />

what packages it should bind in the database.<br />

6.7.1 In practice: Bind the SQL statements in your <strong>pureQuery</strong>Xml file<br />

If you are using IBM ® DB2 ® Database for your database, use the StaticBinder to bind the<br />

statements in your <strong>pureQuery</strong>Xml file in the database.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!