16.10.2015 Views

Getting Startedwith pureQuery

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

234<br />

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

11.8.1 Binding the SQL statements in the interfaces<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 interfaces. You can run the StaticBinder utility either from the<br />

command line or by selecting menu options in IBM Optim Development Studio. Refer to<br />

Chapter 7 for a description of the StaticBinder utility and how to specify what packages it<br />

should bind in the database.<br />

11.8.1.1 In practice: Bind the SQL statements in your interface<br />

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

statements in your interface in the database.<br />

11.8.1.1.1 Specify options for the interface<br />

As for the Generator utility, you can use an options file to specify options for the<br />

StaticBinder utility. Notice the options file named Default.bindProps in Figure 11.8. It<br />

is located in the <strong>pureQuery</strong>Folder directory in the <strong>Getting</strong>StartedWithPureQuery<br />

project.<br />

Figure 11.8 - The options file Default.bindProps in a <strong>pureQuery</strong>-enabled project<br />

Add a line to Default.bindProps for the interface. The StaticBinder’s defaults are fine<br />

for our purposes, so you do not specify any options on the line. The StaticBinder can bind<br />

the interface even without the line, but it is a good practice to add it. Adding everything that<br />

must be bound to the options file makes it easy to bind the application from the command<br />

line. Add a line as shown in Listing 11.31. If you were to add options for the interface, you<br />

would specify them after the equal sign (=).<br />

hrm.inProgress.pdqMethodStyle.HumanResourcesData =<br />

Listing 11.31 - An entry for our interface in Default.bindProps<br />

11.8.1.1.2 Run the StaticBinder utility.<br />

Bind the interface by right-clicking on it in the Package Explorer view and selecting<br />

<strong>pureQuery</strong>, and then selecting Bind…. This is shown in Figure 11.9. Then, choose the<br />

connection that you want to use for the bind and click Finish, as shown in Figure 11.10

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

Saved successfully!

Ooh no, something went wrong!