Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.diag
Class StatementCache  view StatementCache download StatementCache.java

java.lang.Object
  extended byorg.apache.derby.vti.VTITemplate
      extended byorg.apache.derby.diag.StatementCache
All Implemented Interfaces:
java.sql.ResultSet

public final class StatementCache
extends org.apache.derby.vti.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:

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

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


Field Summary
private static org.apache.derby.iapi.sql.ResultColumnDescriptor[] columnInfo
           
private  org.apache.derby.impl.sql.GenericPreparedStatement currentPs
           
private  java.util.Vector data
           
private static java.sql.ResultSetMetaData metadata
           
private  int position
           
private  boolean wasNull
           
 
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
StatementCache()
           
 
Method Summary
 void close()
          This method closes the result set and frees any associated resources.
static void emptyCache()
          Empty the statement cache.
 boolean getBoolean(int colId)
          This method returns the value of the specified column as a Java boolean.
 java.sql.ResultSetMetaData getMetaData()
          This method returns data about the columns returned as part of the result set as a ResultSetMetaData instance.
 java.lang.String getString(int colId)
          This method returns the value of the specified column as a Java String.
 java.sql.Timestamp getTimestamp(int colId)
          This method returns the value of the specified column as a Java java.sql.Timestamp.
 boolean next()
          This method advances to the next row in the result set.
 boolean wasNull()
          This method tests whether the value of the last column that was fetched was actually a SQL NULL value.
 
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, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getInt, getInt, getLong, getLong, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getShort, getShort, getStatement, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isFirst, isLast, last, moveToCurrentRow, moveToInsertRow, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setFetchSize, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateShort, updateShort, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

position

private int position

data

private java.util.Vector data

currentPs

private org.apache.derby.impl.sql.GenericPreparedStatement currentPs

wasNull

private boolean wasNull

columnInfo

private static final org.apache.derby.iapi.sql.ResultColumnDescriptor[] columnInfo

metadata

private static final java.sql.ResultSetMetaData metadata
Constructor Detail

StatementCache

public StatementCache()
               throws java.sql.SQLException
Method Detail

emptyCache

public static void emptyCache()
                       throws java.sql.SQLException
Empty the statement cache. Must be called from a SQL statement, e.g.
                CALL org.apache.derby.diag.StatementCache::emptyCache()
                


next

public boolean next()
Description copied from interface: java.sql.ResultSet
This method advances to the next row in the result set. Any streams open on the current row are closed automatically.


close

public void close()
Description copied from interface: java.sql.ResultSet
This method closes the result set and frees any associated resources.


getString

public java.lang.String getString(int colId)
Description copied from interface: java.sql.ResultSet
This method returns the value of the specified column as a Java String.


getBoolean

public boolean getBoolean(int colId)
Description copied from interface: java.sql.ResultSet
This method returns the value of the specified column as a Java boolean.


getTimestamp

public java.sql.Timestamp getTimestamp(int colId)
Description copied from interface: java.sql.ResultSet
This method returns the value of the specified column as a Java java.sql.Timestamp.


wasNull

public boolean wasNull()
Description copied from interface: java.sql.ResultSet
This method tests whether the value of the last column that was fetched was actually a SQL NULL value.


getMetaData

public java.sql.ResultSetMetaData getMetaData()
Description copied from interface: java.sql.ResultSet
This method returns data about the columns returned as part of the result set as a ResultSetMetaData instance.