Package org.apache.derby.diag
Class StatementCache
- java.lang.Object
-
- org.apache.derby.vti.VTITemplate
-
- org.apache.derby.diag.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()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.derby.vti.VTITemplate
VTITemplate.ColumnDescriptor
-
-
Field Summary
Fields Modifier and Type Field Description private static ResultColumnDescriptor[]columnInfoprivate GenericPreparedStatementcurrentPsprivate java.util.Vector<GenericPreparedStatement>dataprivate static java.sql.ResultSetMetaDatametadataprivate intpositionprivate booleanwasNull
-
Constructor Summary
Constructors Constructor Description StatementCache()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleangetBoolean(int colId)private static ContextgetContextOrNull(java.lang.String contextID)Privileged lookup of a Context.java.sql.ResultSetMetaDatagetMetaData()java.lang.StringgetString(int colId)java.sql.TimestampgetTimestamp(int colId)booleannext()booleanwasNull()-
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
-
-
-
-
Field Detail
-
position
private int position
-
data
private java.util.Vector<GenericPreparedStatement> data
-
currentPs
private GenericPreparedStatement currentPs
-
wasNull
private boolean wasNull
-
columnInfo
private static final ResultColumnDescriptor[] columnInfo
-
metadata
private static final java.sql.ResultSetMetaData metadata
-
-
Constructor Detail
-
StatementCache
public StatementCache() throws StandardException- Throws:
StandardException
-
-
Method Detail
-
next
public boolean next()
-
close
public void close()
-
getString
public java.lang.String getString(int colId)
- Specified by:
getStringin interfacejava.sql.ResultSet- Overrides:
getStringin classVTITemplate
-
getBoolean
public boolean getBoolean(int colId)
- Specified by:
getBooleanin interfacejava.sql.ResultSet- Overrides:
getBooleanin classVTITemplate
-
getTimestamp
public java.sql.Timestamp getTimestamp(int colId)
- Specified by:
getTimestampin interfacejava.sql.ResultSet- Overrides:
getTimestampin classVTITemplate
-
wasNull
public boolean wasNull()
- Specified by:
wasNullin interfacejava.sql.ResultSet- Overrides:
wasNullin classVTITemplate
-
getMetaData
public java.sql.ResultSetMetaData getMetaData()
- Specified by:
getMetaDatain interfacejava.sql.ResultSet- Overrides:
getMetaDatain classVTITemplate
-
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.
-
-