com.onewebsql.util.jdbc
Class QueryResultOp<T,PH,RH>

java.lang.Object
  extended by com.onewebsql.util.jdbc.QueryResultOp<T,PH,RH>
All Implemented Interfaces:
ConnectionOp<T>

public class QueryResultOp<T,PH,RH>
extends Object
implements ConnectionOp<T>

Operation which invokes an SQL query and later invokes QueryResultOp.Operation on the result. The PreparedStatement and ResultSet are open during the excecution of the operation.


Nested Class Summary
static interface QueryResultOp.Operation<T,R>
          An operation which needs access to both an open ResultSet object and an open request object PreparedStatement.
 
Constructor Summary
QueryResultOp(String query, PH parameters, ParameterHandler<PH> parameterHandler, RowHandler<RH> rowHandler, QueryResultOp.Operation<T,RH> operation)
          Constructor.
 
Method Summary
 T invoke(Connection con)
          Invokes the operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryResultOp

public QueryResultOp(String query,
                     PH parameters,
                     ParameterHandler<PH> parameterHandler,
                     RowHandler<RH> rowHandler,
                     QueryResultOp.Operation<T,RH> operation)
Constructor.

Parameters:
query - SQL query
parameters - SQL query parameters
parameterHandler - object which binds parameters to SQL query
rowHandler - object which converts ResultSet object into a Java object
operation - operation to execute
Method Detail

invoke

public T invoke(Connection con)
         throws SQLException
Description copied from interface: ConnectionOp
Invokes the operation.

Specified by:
invoke in interface ConnectionOp<T>
Parameters:
con - database connection
Returns:
result of the operation
Throws:
SQLException - if an exception is thrown


Copyright © 2011-2013 e-point SA. All Rights Reserved.