OUT and INOUT parameters in objects of type <CAL>

When you run an SQL CALL statement, you can return the values of OUT and INOUT parameters in an object of type <CAL>.
Objects of type <CAL> are returned by this version of the call() method of the Data interface:
<CAL> T call(java.lang.String sql, CallHandlerWithParameters<CAL> callHandlerWithParameters, Object... parameters)

With this version of the call() method of the Data interface, the CallHandlerWithParameters object is responsible for processing any query results or update counts that are returned by the stored procedure. That information is not available to the application that invoked the call() method unless it is made available via the returned generic <CAL> object.

The CallHandlerWithParameters object is responsible for processing the OUT and INOUT parameters of the stored procedure and incorporating then into the resulting <CAL> object. Again, that information is not available to the application that invoked the call() method unless it is made available via the returned generic <CAL> object.

If the CallHandlerWithParameters object needs to update any bean or Map parameters passed in the invocation of the call() method, those parameters need to be updated by the handleCall() method of the CallHandlerWithParameters object. In the presence of a CallHandlerWithParameters object, pureQuery does not make any such updates.

For example, consider a stored procedure that is defined to have three IN parameters, no OUT parameters, and some returned query results, with a CallHandlerWithParameters object to process them. The class that implements CallHandlerWithParameters<CAL> is defined like this:

public class mapHandler 
         implements CallHandlerWithParameters<Map<String, Object>>
{
  Map <String, Object> handleCall (CallableStatement cstmt, Object... parameters) throws SQLException
  {
   ...
     }
}

You might invoke the call() method like this:

Connection con = DriverManager.getConnection(...);
Data db = DataFactory.getData(con);
mapHandler chOne = new mapHandler();

Map<String, Object> diffMap = db.call( 
     "CALL getReports(?,?,?)", chOne, p1, p2, p3 );

Feedback