JDBC Monitor

DataGateway provides a JDBC monitoring class which can monitor or manipulate JDBC traffic. JBuilder provides the JDBC Monitor, invoked from Tools|JDBC Monitor, to work with this class at design time. For information on using this class at run time, see Using the JDBC Monitor in a running application in the Database Application Developer's Guide.

JDBC Monitor will monitor any JDBC driver (i.e., any subclass of java.sql.Driver) while it is in use by JBuilder. However, the monitor works best, and is most informative with, Borland's DataGateway JDBC drivers. See the Database Application Developer's Guide topic, Monitoring database connections for more information.

The JDBC Monitor can be used during the design process or while debugging a JBuilder application to display trace output from the driver. The three controls that enable you to set up JDBC Monitor are:

For more information on JDBC Monitor, consult Borland's DataGateway Online User's Guide, available from the DataGateway group when DataGateway is installed.

The Source control

An instance of the JDBC Monitor can only display output from one SQL driver type at a time. To change the Monitor window from one source to another, select Source in the main Monitor window. Select the appropriate check box for the source you want to monitor. Notice that the three check boxes are mutually exclusive.

JDBC Driver Manager (JDBC trace)

Displays all output from all drivers currently loaded by the Driver Manager.

Borland Local Driver (Local)

Displays a list of URLs for every BDE alias on your client machine.

If you choose the Borland Bridge (or Local) Monitor, you can monitor the output from a single alias or from all listed aliases.

Borland Remote Driver for a Single Server (Remote)

Displays a list of URLs for every BDE alias on your server. You can monitor the output from a single alias or from all listed aliases.

Server

When the Remote option is selected, the Server edit box becomes available. The Remote option requires you to type a server name. This machine name can be any machine running DataGateway which is visible to your client machine. You can type in a server name or select the button for a list of available aliases.

After you define a server, JDBC Monitor displays a list of URLs for every alias defined on that machine, including an option to monitor all aliases on that machine. This gives instant connectivity to all BDE drivers running on another machine (i.e., the "middle tier"). Selection of a single alias will restrict monitoring to that alias.

To monitor more than one source, you must bring up another instance of the Monitor window.

The following table describes the output you will see in the JDBC Monitor depending on which source is selected. In this table and in this document, Local and Bridge are synonymous and Remote and Broker are synonymous. The log output from DataGateway is quite different from the output from JDBC.

Driver Class Output InterceptedDescription
java.sql.DriverDriverManager.getLogStream() Standard JDBC driver class. The logStream is supported by the single driver Manager, so there is just one log stream for all of the JDBC drivers running under a VM.
borland.jdbc.Bridge.LocalDriver borland.jdbc.Bridge.Monitor A monitor is a streamable output which can be attached at one of two levels:
  • At the driver level, the monitor displays all output for all instances of the LocalDriver running under the VM.

  • At the URL level, the monitor displays output for all connections to a given URL (the equivalent of a Borland Database Engine alias) running under the VM.
borland.jdbc.Broker.RemoteDriver borland.jdbc.Broker.Monitor The Broker monitor works similarly to the Bridge monitor, but for remote connections. To use the remote monitor, you must first specify a server name where the Borland Broker is running. You may then attach the monitor at one of two levels:
  • For a given server, the monitor displays all output for connections to the RemoteDriver running under the VM.

  • At the individual URL level, the monitor displays the output for a given server/alias combination running under the VM.


The Traces control

The Traces control displays a menu of options for selecting the type of tracing you can enable. This control is only useful when tracing a Borland Driver (either Local or Remote). The trace control offers five options. The description of each option is provided by Borland DataGateway.

You can select to display any combination of these five trace types, depending on the type and detail of information you want to display.

Driver

Adds an entry each time a new instance of the Connection class is created. This option applies to new connections.

Connection

Traces the following:

Statement

Traces the following:

Fetch

Traces each record fetch.

Result Set

Traces each close result set.


The Output control

The Output control displays a menu of options for handling the current contents of the data stream.

Clear

Clears the contents of the Monitor window.

Save

Saves the contents of the monitor window. This option displays a dialog requesting a file name. The current contents of the stream will be saved to this file. The file is not continuously updated, the data is written to the file on an as-requested basis.