Class StatementCache

java.lang.Object
org.apache.derby.vti.VTITemplate
org.apache.derby.diag.StatementCache
All Implemented Interfaces:
AutoCloseable, ResultSet, 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()