Class AsyncQueryRunner.QueryCallableStatement<T>

  • Type Parameters:
    T - The type of the result from the call to handle.
    All Implemented Interfaces:
    java.util.concurrent.Callable<T>
    Enclosing class:
    AsyncQueryRunner

    protected class AsyncQueryRunner.QueryCallableStatement<T>
    extends java.lang.Object
    implements java.util.concurrent.Callable<T>
    Class that encapsulates the continuation for query calls.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean closeConn  
      private java.sql.Connection conn  
      private java.lang.Object[] params  
      private java.sql.PreparedStatement ps  
      private ResultSetHandler<T> rsh  
      private java.lang.String sql  
    • Constructor Summary

      Constructors 
      Constructor Description
      QueryCallableStatement​(java.sql.Connection conn, boolean closeConn, java.sql.PreparedStatement ps, ResultSetHandler<T> rsh, java.lang.String sql, java.lang.Object... params)
      Creates a new QueryCallableStatement instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T call()
      The actual call to handle() method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sql

        private final java.lang.String sql
      • params

        private final java.lang.Object[] params
      • conn

        private final java.sql.Connection conn
      • closeConn

        private final boolean closeConn
      • ps

        private final java.sql.PreparedStatement ps
    • Constructor Detail

      • QueryCallableStatement

        public QueryCallableStatement​(java.sql.Connection conn,
                                      boolean closeConn,
                                      java.sql.PreparedStatement ps,
                                      ResultSetHandler<T> rsh,
                                      java.lang.String sql,
                                      java.lang.Object... params)
        Creates a new QueryCallableStatement instance.
        Parameters:
        conn - The connection to use for the batch call.
        closeConn - True if the connection should be closed, false otherwise.
        ps - The PreparedStatement to be executed.
        rsh - The handler that converts the results into an object.
        sql - The SQL statement to execute.
        params - An array of query replacement parameters. Each row in this array is one set of batch replacement values.
    • Method Detail

      • call

        public T call()
               throws java.sql.SQLException
        The actual call to handle() method.
        Specified by:
        call in interface java.util.concurrent.Callable<T>
        Returns:
        an array of update counts containing one element for each command in the batch.
        Throws:
        java.sql.SQLException - if a database access error occurs.
        See Also:
        ResultSetHandler.handle(ResultSet)