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.

240<br />

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

D. Specify the interface to a method named<br />

generateImplementationClass in the<br />

com.ibm.pdq.runtime.Data interface.<br />

6. If you want to customize how <strong>pureQuery</strong> generates the implementation classes for<br />

your interfaces, you can specify the options that you want to use in an options file.<br />

In IBM Optim Development Studio, what is the name of that file?<br />

A. Default.bindProps<br />

B. pdq.properties<br />

C. Default.genProps<br />

D. generator.properties<br />

7. When you run an annotated-method style application with the property<br />

pdq.executionMode set to the value STATIC, what happens if your application<br />

executes an SQL statement that is not bound in the database?<br />

A. The SQL statement executes statically<br />

B. The SQL statement executes dynamically<br />

C. <strong>pureQuery</strong> throws an exception<br />

D. None of the above<br />

8. For an interface of annotated methods, the implementation classes that <strong>pureQuery</strong><br />

generates implements another interface. What is the other interface? Why is this<br />

helpful?<br />

9. What is one way in which you can close the java.sql.Connection object<br />

associated with an instance of an interface?<br />

10. What are some of the benefits of using the annotated method style?<br />

11. What would a user need to do in order to generate their own customized dataaccess<br />

code using the <strong>pureQuery</strong> tooling?<br />

11.12 Exercise<br />

In hrm.inProgress.pdqMethodStyle.HumanResourcesManager, the method<br />

displayEmployeeReportChain creates the “Employee Report Chain” screen. This<br />

screen needs to display the employees that report to the specified employee, as well as the<br />

specified employee’s manager. Look for the comments // TODO: Add <strong>pureQuery</strong><br />

code here. in the method and add the necessary <strong>pureQuery</strong> code. There are two places<br />

in displayEmployeeReportChain that you need to update; one needs a new annotated<br />

method, and the other can use one of the existing annotated methods. Comments in the<br />

code show the SQL statements that you can use for the operations. The completed

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

Saved successfully!

Ooh no, something went wrong!