Class StatementFacade.StatementProxy

java.lang.Object
org.apache.tomcat.jdbc.pool.StatementFacade.StatementProxy
All Implemented Interfaces:
InvocationHandler
Enclosing class:
StatementFacade

protected class StatementFacade.StatementProxy extends Object implements InvocationHandler
Proxy for a SQL statement. Refuses calls once the borrow that created it has ended, and seals every result set the statement hands back.
  • Field Details

    • delegate

      protected volatile Object delegate
      The delegated statement, nulled once a close has been forwarded. A handle can be closed from a thread other than the one invoking on it, so the field is read by more threads than the one that nulls it and, like the borrow-ended flag, must be volatile to reach them at all.
    • query

      protected final String query
      The SQL query text.
    • connection

      protected final Object connection
      The pooled connection the statement was created from, as reported by Statement.getConnection(). It is the handle the application borrowed, so it stops working once that borrow has been returned, while the driver's own connection would have gone on serving whoever borrowed the connection next.
  • Constructor Details

    • StatementProxy

      public StatementProxy(Object parent, String query, Object connection)
      Constructs a StatementProxy.
      Parameters:
      parent - the parent statement
      query - the SQL query text
      connection - the pooled connection the statement was created from
  • Method Details