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.

276<br />

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

object contains all of the rows. Implementations of the<br />

com.ibm.pdq.runtime.handlers.RowHandler interface customize the object<br />

contains for each row. Implementations of the<br />

com.ibm.pdq.runtime.handlers.CallHandlerWithParameters interface<br />

customize the results of stored procedure calls.<br />

13.6 Review questions<br />

1. If none of the ways in which <strong>pureQuery</strong> can set the values of SQL parameters<br />

meet the needs of your application, what can you do?<br />

2. For an annotated or inline method that executes a stored procedure call, which of<br />

the following actions must the handleParameters method of a<br />

com.ibm.pdq.runtime.handlers.ParameterHandler implementation do<br />

with the java.sql.PreparedStatement object?<br />

A. Set the values of IN and INOUT parameters<br />

B. Call the close() method<br />

C. Call one of the executeXXX() methods to run the SQL statement<br />

D. Register OUT and INOUT parameters<br />

3. If none of the ways in which <strong>pureQuery</strong> can return the query result of an SQL<br />

SELECT statement meet the needs of your application, what can you do?<br />

4. What does the type parameter RES indicate for the<br />

com.ibm.pdq.runtime.handlers.ResultHandler interface?<br />

5. For an implementation of<br />

com.ibm.pdq.runtime.handlers.RowHandler, what should the<br />

handle method do with the java.sql.ResultSet parameter?<br />

A. Call the next() method<br />

B. Use getXXX methods to put the contents of the current row in the object<br />

that the method returns<br />

C. Use the absolute(int) method to move to the current row<br />

D. Call the close() method<br />

6. What is the purpose of the ROW object parameter of the handle method of the<br />

com.ibm.pdq.runtime.handlers.RowHandler interface?<br />

7. If none of the ways in which <strong>pureQuery</strong> can return the results of a stored procedure<br />

call meet the needs of your application, what can you do?<br />

8. How do you specify handlers in the inline style?

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

Saved successfully!

Ooh no, something went wrong!