Class StatementDuration
- All Implemented Interfaces:
AutoCloseable, ResultSet, Wrapper, AwareVTI
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:
- TS varchar(26) - not nullable. The timestamp of the statement.
- THREADID varchar(80) - not nullable. The thread name.
- XID varchar(15) - not nullable. The transaction ID.
- LOGTEXT long varchar - nullable. Text of the statement or commit or rollback.
- DURATION varchar(10) - not nullable. Duration, in milliseconds, of the statement.
-
Nested Class Summary
Nested classes/interfaces inherited from class VTITemplate
VTITemplate.ColumnDescriptor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprivate BufferedReaderprivate static final ResultColumnDescriptor[]private String[]private static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate intprivate booleanprivate Stringprivate InputStreamReaderprivate InputStreamprivate intprivate Stringprivate static final ResultSetMetaDataprivate intprivate intFields inherited from interface 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
ConstructorsConstructorDescriptionStatementDuration() accesses the error log in derby.system.home, if set, otherwise it looks in the current directory.StatementDuration(String inputFileName) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getString(int columnNumber) All columns in StatementDuration VTI have String data types.booleannext()private StringsetupColumn(int columnNumber) private TimestampstringToTimestamp(String raw) booleanwasNull()Methods inherited from class VTITemplate
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, updateTimestampMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResultSet
updateObject, updateObject, updateObject, updateObject
-
Field Details
-
gotFile
private boolean gotFile -
inputFileStreamReader
-
inputStream
-
bufferedReader
-
inputFileName
-
hashTable
-
line
-
endTimestampIndex
private int endTimestampIndex -
threadIndex
private int threadIndex -
xidIndex
private int xidIndex -
lccidIndex
private int lccidIndex -
currentRow
-
END_TIMESTAMP
- See Also:
-
BEGIN_THREAD_STRING
- See Also:
-
END_THREAD_STRING
- See Also:
-
BEGIN_XID_STRING
- See Also:
-
END_XID_STRING
- See Also:
-
BEGIN_EXECUTING_STRING
- See Also:
-
END_EXECUTING_STRING
- See Also:
-
columnInfo
-
metadata
-
-
Constructor Details
-
StatementDuration
StatementDuration() accesses the error log in derby.system.home, if set, otherwise it looks in the current directory. StatementDuration('filename') will access the specified file name.- Throws:
StandardException
-
StatementDuration
- Throws:
StandardException
-
-
Method Details
-
getMetaData
- Specified by:
getMetaDatain interfaceResultSet- Overrides:
getMetaDatain classVTITemplate- See Also:
-
next
- Throws:
SQLException- If database access error occurs.- See Also:
-
stringToTimestamp
- Throws:
SQLException
-
close
public void close()- See Also:
-
getString
All columns in StatementDuration VTI have String data types.- Specified by:
getStringin interfaceResultSet- Overrides:
getStringin classVTITemplate- Throws:
SQLException- If database access error occurs.- See Also:
-
setupColumn
- Throws:
SQLException
-
wasNull
public boolean wasNull()- Specified by:
wasNullin interfaceResultSet- Overrides:
wasNullin classVTITemplate- See Also:
-