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.

A. In a getData method in the<br />

com.ibm.pdq.runtime.factory.DataFactory class<br />

Chapter 13 – Handlers 277<br />

B. With the setHandler method on the com.ibm.pdq.runtime.Data<br />

interface<br />

C. As parameters to queryXXX and call methods in the<br />

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

D. None of the above<br />

9. Assume that you have an annotated method that has three method parameters for<br />

specifying the values of the SQL parameters. If you want to use a handler for this<br />

method, and the handler has a no-argument constructor, which of the following<br />

ways can you use to specify the handler?<br />

A. As the first parameter to the method (making the current method<br />

parameters the second, third, and forth parameters)<br />

B. By specifying the class in the in the<br />

com.ibm.pdq.annotation.Handler annotation<br />

C. As the last parameter to the method<br />

D. By casting the interface as an instance of com.ibm.pdq.runtime.Data<br />

and calling the setHandler method of the Data interface<br />

10. Assume that you have an annotated method that has three method parameters for<br />

specifying the values of the SQL parameters. If you want to use a handler for this<br />

method, and the handler does not have a no-argument constructor, which of the<br />

following ways can you use to specify the handler?<br />

A. As the first parameter to the method (making the current method<br />

parameters the second, third, and forth parameters)<br />

B. By specifying the class in the in the<br />

com.ibm.pdq.annotation.Handler annotation<br />

C. As the last parameter to the method<br />

D. By casting the interface as an instance of com.ibm.pdq.runtime.Data<br />

and calling the setHandler method of the Data interface<br />

13.7 Exercise<br />

Write an implementation of<br />

com.ibm.pdq.runtime.handlers.CallHandlerWithParameters and change the<br />

inline method that executes the stored procedure bonus_increase in<br />

hrm.inProgress.pdqInlineStyleWithHandlers.HumanResoucesManager to use<br />

it. One solution is provided in the hrm.completed.pdqCompleted package.

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

Saved successfully!

Ooh no, something went wrong!