Documentation of 'org.apache.derby.diag.StatementDuration' Java class
StatementDuration
org.apache.derby.diag

Class StatementDuration

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.sql.ResultSet, java.sql.Wrapper, AwareVTI


    public class StatementDuration
    extends VTITemplate
    StatementDuration is a virtual table which can be used to analyze the execution duration of the statements of "interest" in db2j.log or a specified file when db2j.language.logStatementText=true.

    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.
    • Constructor Detail

      • StatementDuration

        public StatementDuration()
                          throws StandardException
        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
    • Method Detail

      • getMetaData

        public java.sql.ResultSetMetaData getMetaData()
        Specified by:
        getMetaData in interface java.sql.ResultSet
        Overrides:
        getMetaData in class VTITemplate
        See Also:
        ResultSet.getMetaData()
      • next

        public boolean next()
                     throws java.sql.SQLException
        Throws:
        java.sql.SQLException - If database access error occurs.
        See Also:
        ResultSet.next()
      • close

        public void close()
        See Also:
        ResultSet.close()
      • getString

        public java.lang.String getString(int columnNumber)
                                   throws java.sql.SQLException
        All columns in StatementDuration VTI have String data types.
        Specified by:
        getString in interface java.sql.ResultSet
        Overrides:
        getString in class VTITemplate
        Throws:
        java.sql.SQLException - If database access error occurs.
        See Also:
        ResultSet.getString(int)
      • wasNull

        public boolean wasNull()
        Specified by:
        wasNull in interface java.sql.ResultSet
        Overrides:
        wasNull in class VTITemplate
        See Also:
        ResultSet.wasNull()

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.