HPlogo HP Driver for JDBC User's Manual: HP 3000 MPE/iX Computer Systems > Chapter 6 Troubleshooting

Client Tracing

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Tracing of the JDBC Driver client class files is invoked by adding tracing commands to the connection URL. The connection URL can be altered to both invoke tracing, and to control the type of information that is traced. The tracing information is sent to a Java stream, which must be specified by the application using the java.sql.DriverManager.setLogStream method.

Both the tracing level and tracing output must be specified before any tracing can be done.

Note that the use of tracing will impact performance of the application. The greater the detail in the tracing, the slower the performance of the application.

The URL syntax to invoke tracing is:

"jdbc:allbase://server[:port]/database?TRACE=trace"

where trace is any vertical bar (|) separated combination of the values:

ARGUMENTS

Trace HP Driver for JDBC class method arguments. Input arguments and return values are all traced. Only the methods called by the application are traced.

ARGUMENTS_ALL

Trace all HP Driver for JDBC class methods that are called by both the application and the driver itself.

TIME

Include the time in HHMMSSFFF format on all tracing output lines where HH is the hour from 00 to 23, MM is the minute from 00 to 59, SS is the second from 00 to 59, and FFF is the millisecond from 000 to 999. The information appears in the third column of the tracing output.

DATE

Include the date in YYYYMMDD format on all tracing output lines where YYYY is the year from 0000 to 9999, MM is the month from 01 to 12, DD is the day of the month from 00 to 31. This information appears in the second column of the tracing output.

TIMESTAMP

Include both the date and the time on all tracing output lines. This is just a combination of the DATE and TIME tracing values.

OBJECT

Include the object hash code in the format HHHHHHHH on all tracing output lines where HHHHHHHH is the eight digit hexadecimal value of the hash code. This information appears in the first column of the tracing output.

THREAD

Include the executing thread name on all tracing output lines. This information appears as the fourth column of the tracing output.

DEBUG

Trace debugging statements from the driver. This will produce a large amount of output, so it should be used sparingly.

CONNECTION

Trace driver connection information.

NETWORK

Trace driver network information.

ERROR

Trace driver errors.

WARNING

Trace driver warnings.

SQL

Trace SQL statements that are passed to the driver.

ALL

Trace everything.

For example, the URL to turn on tracing of all connections with time stamp information would be:

"jdbc:allbase://server/database?TRACE=CONNECTION|TIMESTAMP"

Do not use any space characters between tracing levels and the vertical bar separator as some browsers and web servers do not allow space characters in a URL.

NOTE: Remember that the application must also set the tracing stream using the java.sql.DriverManager.setLogStream method.

Here is a sample output of a JDBC trace log using the trace flag ALL:

0f457ce2 19980917 110116.300 main JdbcConnection.createStatement(void)0f457ce2 19980917 110116.312 main JdbcConnection.createStatement() =    JdbcStatement@0f458ef40f458df3 19980917 110116.903 main    JdbcResultSet.new(SolidResultSet@0f458e9b)0f458df3 19980917 110116.907 main JdbcResultSet.new() =    JdbcResultSet@0f458df30f458df3 19980917 110117.088 main JdbcResultSet.getMetaData(void)0f458df3 19980917 110117.152 main JdbcResultSet.getMetaData() =    JdbcResultSetMetaData@0f458c9f0f458df3 19980917 110117.164 main JdbcResultSet.next(void)0f458df3 19980917 110117.167 main JdbcResultSet.next() = true0f458df3 19980917 110117.170 main JdbcResultSet.getString(1)0f458df3 19980917 110117.199 main JdbcResultSet.getString() = 330f458df3 19980917 110117.202 main JdbcResultSet.wasNull(void)0f458df3 19980917 110117.205 main JdbcResultSet.wasNull() = false0f458df3 19980917 110117.212 main JdbcResultSet.next(void)0f458df3 19980917 110117.215 main JdbcResultSet.next() = false0f458df3 19980917 110117.218 main JdbcResultSet.close(void)0f458df3 19980917 110117.221 main JdbcResultSet.close() = void0f457ce2 19980917 110118.087 main JdbcConnection.close(void)0f457ce2 19980917 110118.090 main JdbcConnection.close:
 Closing JdbcConnection    object. Disconnecting all connections.0f457ce2 19980917 110118.093 main  JdbcConnection.close: Closing connection    number 00f457ce2 19980917 110118.099 main  JdbcConnection.close:
 JdbcConnection object    closed0f457ce2 19980917 110118.102 main JdbcConnection.close() = void

The first column shows the object hash code. Note that the object hash code can be matched with the objects returned by various methods. The second column shows the date, September 17, 1998. The third column shows the time, 11:01 AM. The fourth column shows the thread name; in this case there is only the main thread. The last column contains the tracing information. In each line, the class and method are logged.

Feedback to webmaster