You can specify how to map the results of queries and the
results of calls to stored procedures to Java™ objects.
You do so by writing classes
that implement one of four interfaces.
Each of these interfaces defines a method that you can implement with
your own custom code for handling returned results.
The RowHandler<ROW> interface
Use an implementation of the com.ibm.pdq.runtime.handlers.RowHandler<ROW> interface
to customize how pureQuery returns each row of a query result from
an SQL query.
The ResultHandler<RES> interface
You can create an implementation of the com.ibm.pdq.runtime.handlers.ResultHandler<RES> interface
that pureQuery can use to create an object that represents a query
result.
The CallHandlerWithParameters<CAL> interface
You can customize how pureQuery handles the results from
an SQL stored procedure CALL by using an implementation of the com.ibm.pdq.runtime.handlers.CallHandlerWithParameters<CAL>
interface. pureQuery can use that implementation to create the object
to be returned from the annotated or inline method that ran the CALL
statement. Moreover, the implementation can carry out any additional
processing that you might require, such as updating OUT and INOUT
parameters.
The CallHandler<T> interface
IBM® recommends that
you use the CallHandlerWithParameters<T> interface
instead of the CallHandler<T> interface.