Class StatementCache

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.sql.ResultSet, java.sql.Wrapper, AwareVTI

    public final class StatementCache
    extends VTITemplate
    StatementCache is a virtual table that shows the contents of the SQL statement cache. This virtual table can be invoked by calling it directly.
     select * from new org.apache.derby.diag.StatementCache() t

    The StatementCache virtual table has the following columns:

    • ID CHAR(36) - not nullable. Internal identifier of the compiled statement.
    • SCHEMANAME VARCHAR(128) - nullable. Schema the statement was compiled in.
    • SQL_TEXT VARCHAR(32672) - not nullable. Text of the statement
    • UNICODE BIT/BOOLEAN - not nullable. Always true.
    • VALID BIT/BOOLEAN - not nullable. True if the statement is currently valid, false otherwise
    • COMPILED_AT TIMESTAMP nullable - time statement was compiled, requires STATISTICS TIMING to be enabled.

    The internal identifier of a cached statement matches the toString() method of a PreparedStatement object for a Derby database.

    This class also provides a static method to empty the statement cache, StatementCache.emptyCache()

    • Method Detail

      • next

        public boolean next()
      • close

        public void close()
      • getString

        public java.lang.String getString​(int colId)
        Specified by:
        getString in interface java.sql.ResultSet
        Overrides:
        getString in class VTITemplate
      • getBoolean

        public boolean getBoolean​(int colId)
        Specified by:
        getBoolean in interface java.sql.ResultSet
        Overrides:
        getBoolean in class VTITemplate
      • getTimestamp

        public java.sql.Timestamp getTimestamp​(int colId)
        Specified by:
        getTimestamp in interface java.sql.ResultSet
        Overrides:
        getTimestamp in class VTITemplate
      • wasNull

        public boolean wasNull()
        Specified by:
        wasNull in interface java.sql.ResultSet
        Overrides:
        wasNull in class VTITemplate
      • getMetaData

        public java.sql.ResultSetMetaData getMetaData()
        Specified by:
        getMetaData in interface java.sql.ResultSet
        Overrides:
        getMetaData in class VTITemplate
      • getContextOrNull

        private static Context getContextOrNull​(java.lang.String contextID)
        Privileged lookup of a Context. Must be private so that user code can't call this entry point.