Hitachi

Hitachi Advanced Database Application Development Guide


7.7.1 JDBC interface method traces

You can acquire a JDBC interface method trace as troubleshooting information when you call a method in the JDBC interface.

Organization of this subsection

(1) Environment setup

(a) Connection with the DriverManager class

The following explains the environment setup procedure.

To set up the environment:
  1. Specify a valid log writer by executing the setLogWriter method of the DriverManager class.

  2. Connect to the HADB server by executing the getConnection method of the DriverManager class. In the url or info argument of the getConnection method, specify that a JDBC interface method trace is to be acquired (specify methodtrace and tracenum).

For details about the specification of the url argument of the getConnection method, see (a) Values to be specified in the url argument (specifying the URL for the connection) in (2) Connecting to the HADB server with the getConnection method in 7.3.1 Using the getConnection method of the DriverManager class to connect to the HADB server.

For details about the specification of the info argument of the getConnection method, see (d) Values to be specified in the info argument (specifying the user properties) in (2) Connecting to the HADB server with the getConnection method in 7.3.1 Using the getConnection method of the DriverManager class to connect to the HADB server.

(b) Connection with the DataSource class

The following explains the environment setup procedure.

To set up the environment:
  1. Specify a valid log writer by executing the setLogWriter method of the DataSource or ConnectionPoolDataSource interface.

  2. Specify that a JDBC interface method trace is to be acquired by executing the setInterfaceMethodTrace and setTraceNumber methods in the connection information setup and acquisition interface.

For details about the setLogWriter method of the DataSource interface, see 10.2.7 setLogWriter(PrintWriter out). For details about the setLogWriter method of the ConnectionPoolDataSource interface, see 10.3.7 setLogWriter(PrintWriter out).

For details about the setInterfaceMethodTrace method, see 10.5.14 setInterfaceMethodTrace(boolean flag). For details about the setTraceNumber method, see 10.5.18 setTraceNumber(int num).

(2) Rules for acquiring a JDBC interface method trace

This subsection describes the rules for acquiring a JDBC interface method trace.

(3) Output example

This subsection shows an output example of a JDBC interface method trace. The item numbers in the explanation below correspond to the bracketed numbers in the figure.

Output example

[Figure]

Explanation

  1. [Hitachi Advanced Data Binder JDBC Driver]

    Name of the JDBC driver

  2. [JDBC Interface Entry ] and [JDBC Interface Return]

    [JDBC Interface Entry ]: Call to a JDBC method

    [JDBC Interface Return]: Return from a JDBC method

  3. [XXXXX.YYYYY]

    YYYYY method of the XXXXX class

  4. select * from pp

    Argument in the JDBC method (for the password argument, an asterisk (*) is output, as in password=*)

  5. com.hitachi.hadb.jdbc.Adb...

    Value returned from the JDBC method