The script content on this page is for navigation purposes only and does not alter the content in any way.

D Tracking JDBC Calls with WebLogic JDBC Spy

WebLogic JDBC Spy is a wrapper that wraps a Oracle Type 4 JDBC driver. It logs detailed information about JDBC calls issued by an application and then passes the calls to the wrapped Oracle Type 4 JDBC driver. You can use the information in the logs to help troubleshoot problems in your application. WebLogic JDBC Spy provides the following advantages:

Logging is JDBC 4.0-compliant.

Logging works with all Oracle Type 4 JDBC drivers.

Logging is consistent, regardless of which Oracle Type 4 JDBC driver is used.

All parameters and function results for JDBC calls can be logged.

Logging can be enabled without changing the application, but instead by changing the JDBC data source in your WebLogic Server configuration.

Note:

The WebLogic JDBC Spy implements standard JDBC APIs only. It does not implement JDBC extensions implemented in other Oracle Type 4 JDBC drivers. If your application uses JDBC extensions, you may see errors when using the WebLogic JDBC Spy.

Configuring WebLogic JDBC Data Sources for WebLogic JDBC Spy

To use WebLogic JDBC Spy with WebLogic Server, you add JDBC Spy attributes to the end of the URL in the JDBC data source configuration.

Note:

The wlspy.jar has been deprecated. This functionality is now built into the driver jar files and can be enabled by setting the SpyAttributes connection parameter.

In the WebLogic Server Administration Console or in the configuration file for your WebLogic domain, append the WebLogic JDBC Spy options to the data source URL. Enclose all JDBC Spy options in one set of parentheses; separate multiple options with a semi-colon.

In the Administration Console on the Domain Configurations > Data Sources, select the particular Data Source that you want to be spy enabled. Open the Connection Pool tab and add the spyAttributes to the end of the existing URL. For example:

When logIS=nosingleread, logging on InputStream and Reader objects is active; however logging of the single-byte read InputStream.read() or single-character Reader.read() is suppressed. This avoids the generation of large log files containing single-byte / single character read messages.

The default is no.

logTName={yes or no}

Specifies whether WebLogic JDBC Spy logs the name of the current thread. The default is no.

timestamp={yes or no}

Specifies whether a timestamp should be included on each line of the WebLogic JDBC Spy log.

Footnote 1: The WebLogic JDBC Spy driver is registered. The spy>> prefix indicates that this line has been logged by WebLogic JDBC Spy.
Footnote 2: The JDBC Driver Manager logs a message each time a JDBC driver is registered.
Footnote 3: This is the logging of the JDBC Driver Manager. It logs a message each time a JDBC application makes a connection.
Footnote 4: The application connects with the specified URL. The User Name and Password are specified using properties.
Footnote 5: This is the logging of the JDBC Driver Manager. It logs a message each time a successful connection is made.
Footnote 6: The application checks to see if there are any warnings. In this example, no warnings are present.
Footnote 7: The statement "select empno,ename,job from emp where empno=7369" is created.
Footnote 8: The statement "select empno,ename,job from emp where empno=7369" is created.
Footnote 9: Some metadata is requested.
Footnote 10: Some metadata is requested.
Footnote 11: Some metadata is requested.
Footnote 12: Some metadata is requested.
Footnote 13: Some metadata is requested.
Footnote 14: The first row is fetched and its data retrieved.
Footnote 15: The first row is fetched and its data retrieved.
Footnote 16: The first row is fetched and its data retrieved.
Footnote 17: The first row is fetched and its data retrieved.
Footnote 18: The application attempts to fetch the second row, but the database returned only one row for this query.
Footnote 19: After fetching all data, the result set is closed.
Footnote 20: The application finishes and disconnects.