Class StatementFinalizer.StatementEntry

  • Enclosing class:
    StatementFinalizer

    protected class StatementFinalizer.StatementEntry
    extends java.lang.Object
    Entry that tracks a statement and its allocation stack. The statement is held strongly: it must stay closeable until the application or the connection return disposes of it.
    • Constructor Summary

      Constructors 
      Constructor Description
      StatementEntry​(java.sql.Statement statement)
      Creates a new StatementEntry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean close()
      Closes the tracked statement unless the driver reports it closed already and, with tracing on, reports a statement the application left open.
      java.lang.Throwable getAllocationStack()
      Returns the stack trace from when this statement was created.
      java.sql.Statement getStatement()
      Returns the tracked statement.
      • Methods inherited from class java.lang.Object

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

      • StatementEntry

        public StatementEntry​(java.sql.Statement statement)
        Creates a new StatementEntry.
        Parameters:
        statement - the statement to track
    • Method Detail

      • getStatement

        public java.sql.Statement getStatement()
        Returns the tracked statement.
        Returns:
        the statement
      • getAllocationStack

        public java.lang.Throwable getAllocationStack()
        Returns the stack trace from when this statement was created.
        Returns:
        the allocation stack trace, or null if tracing is disabled
      • close

        public boolean close()
        Closes the tracked statement unless the driver reports it closed already and, with tracing on, reports a statement the application left open.
        Returns:
        true if the statement is closed - because it was found closed or because the close succeeded; false if an attempted close failed and the statement may still be open