Package org.apache.derby.diag
Class StatementCache
java.lang.Object
org.apache.derby.vti.VTITemplate
org.apache.derby.diag.StatementCache
- All Implemented Interfaces:
AutoCloseable
,ResultSet
,Wrapper
,AwareVTI
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()
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.derby.vti.VTITemplate
VTITemplate.ColumnDescriptor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ResultColumnDescriptor[]
private GenericPreparedStatement
private Vector
<GenericPreparedStatement> private static final ResultSetMetaData
private int
private boolean
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
getBoolean
(int colId) private static Context
getContextOrNull
(String contextID) Privileged lookup of a Context.getString
(int colId) getTimestamp
(int colId) boolean
next()
boolean
wasNull()
Methods inherited from class org.apache.derby.vti.VTITemplate
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getContext, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getReturnTableSignature, getRow, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, isWrapperFor, last, moveToCurrentRow, moveToInsertRow, notImplemented, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setContext, setFetchDirection, setFetchSize, unwrap, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.sql.ResultSet
updateObject, updateObject, updateObject, updateObject
-
Field Details
-
position
private int position -
data
-
currentPs
-
wasNull
private boolean wasNull -
columnInfo
-
metadata
-
-
Constructor Details
-
StatementCache
- Throws:
StandardException
-
-
Method Details
-
next
public boolean next() -
close
public void close() -
getString
- Specified by:
getString
in interfaceResultSet
- Overrides:
getString
in classVTITemplate
-
getBoolean
public boolean getBoolean(int colId) - Specified by:
getBoolean
in interfaceResultSet
- Overrides:
getBoolean
in classVTITemplate
-
getTimestamp
- Specified by:
getTimestamp
in interfaceResultSet
- Overrides:
getTimestamp
in classVTITemplate
-
wasNull
public boolean wasNull()- Specified by:
wasNull
in interfaceResultSet
- Overrides:
wasNull
in classVTITemplate
-
getMetaData
- Specified by:
getMetaData
in interfaceResultSet
- Overrides:
getMetaData
in classVTITemplate
-
getContextOrNull
Privileged lookup of a Context. Must be private so that user code can't call this entry point.
-