java.lang.AutoCloseable
, java.sql.ResultSet
, java.sql.Wrapper
, AwareVTI
public class StatementDuration extends VTITemplate
A limitation is that, for each transaction ID, a row will not be returned for the last statement with that transaction id. (Transaction IDs change within a connection after a commit or rollback, if the transaction that just ended modified data.)
The execution duration is the time between the beginning of execution of two successive statements. There are a number of reasons why this time may not be accurate. The duration could include time spent in the application waiting for user input, doing other work, etc. It may also only include a portion of the actual execution time, if the application executes a new statement before draining the previous open ResultSet. StatementDuration can be used to get a rough sense of where the bottlenecks in an application's JDBC code are.
The StatementDuration virtual table has the following columns:
VTITemplate.ColumnDescriptor
Modifier and Type | Field | Description |
---|---|---|
private static java.lang.String |
BEGIN_EXECUTING_STRING |
|
private static java.lang.String |
BEGIN_THREAD_STRING |
|
private static java.lang.String |
BEGIN_XID_STRING |
|
private java.io.BufferedReader |
bufferedReader |
|
private static ResultColumnDescriptor[] |
columnInfo |
|
private java.lang.String[] |
currentRow |
|
private static java.lang.String |
END_EXECUTING_STRING |
|
private static java.lang.String |
END_THREAD_STRING |
|
private static java.lang.String |
END_TIMESTAMP |
|
private static java.lang.String |
END_XID_STRING |
|
private int |
endTimestampIndex |
|
private boolean |
gotFile |
|
private java.util.Hashtable<java.lang.String,java.lang.String[]> |
hashTable |
|
private java.lang.String |
inputFileName |
|
private java.io.InputStreamReader |
inputFileStreamReader |
|
private java.io.InputStream |
inputStream |
|
private int |
lccidIndex |
|
private java.lang.String |
line |
|
private static java.sql.ResultSetMetaData |
metadata |
|
private int |
threadIndex |
|
private int |
xidIndex |
Constructor | Description |
---|---|
StatementDuration() |
StatementDuration() accesses the error log in
derby.system.home, if set, otherwise it looks in the current directory.
|
StatementDuration(java.lang.String inputFileName) |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
java.sql.ResultSetMetaData |
getMetaData() |
|
java.lang.String |
getString(int columnNumber) |
All columns in StatementDuration VTI have String data types.
|
boolean |
next() |
|
private java.lang.String |
setupColumn(int columnNumber) |
|
private java.sql.Timestamp |
stringToTimestamp(java.lang.String raw) |
|
boolean |
wasNull() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
updateObject, updateObject, updateObject, updateObject
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, 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, 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
private boolean gotFile
private java.io.InputStreamReader inputFileStreamReader
private java.io.InputStream inputStream
private java.io.BufferedReader bufferedReader
private java.lang.String inputFileName
private java.util.Hashtable<java.lang.String,java.lang.String[]> hashTable
private java.lang.String line
private int endTimestampIndex
private int threadIndex
private int xidIndex
private int lccidIndex
private java.lang.String[] currentRow
private static final java.lang.String END_TIMESTAMP
private static final java.lang.String BEGIN_THREAD_STRING
private static final java.lang.String END_THREAD_STRING
private static final java.lang.String BEGIN_XID_STRING
private static final java.lang.String END_XID_STRING
private static final java.lang.String BEGIN_EXECUTING_STRING
private static final java.lang.String END_EXECUTING_STRING
private static final ResultColumnDescriptor[] columnInfo
private static final java.sql.ResultSetMetaData metadata
public StatementDuration() throws StandardException
StandardException
public StatementDuration(java.lang.String inputFileName) throws StandardException
StandardException
public java.sql.ResultSetMetaData getMetaData()
getMetaData
in interface java.sql.ResultSet
getMetaData
in class VTITemplate
ResultSet.getMetaData()
public boolean next() throws java.sql.SQLException
java.sql.SQLException
- If database access error occurs.ResultSet.next()
private java.sql.Timestamp stringToTimestamp(java.lang.String raw) throws java.sql.SQLException
java.sql.SQLException
public void close()
ResultSet.close()
public java.lang.String getString(int columnNumber) throws java.sql.SQLException
getString
in interface java.sql.ResultSet
getString
in class VTITemplate
java.sql.SQLException
- If database access error occurs.ResultSet.getString(int)
private java.lang.String setupColumn(int columnNumber) throws java.sql.SQLException
java.sql.SQLException
public boolean wasNull()
wasNull
in interface java.sql.ResultSet
wasNull
in class VTITemplate
ResultSet.wasNull()
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.