DataGateway provides a JDBC monitoring class which can monitor or manipulate JDBC traffic. JBuilder provides a user interface, 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.
JDBC Monitor will monitor any JDBC driver (i.e., any subclass of java.sql.Driver) while they are in use by JBuilder. However, it works best, and is most informative with, Borland's DataGateway JDBC drivers.
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:
More information on the JDBC Monitor can be found in the Borland DataGateway help system.
The JDBC trace option displays all output from all drivers currently loaded by the Driver Manager.
The Local option 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.
The Remote option 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.
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 to the right to get a list of available aliases. After defining 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.
Users who wish to monitor more than one source 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 Intercepted | Description |
java.sql.Driver | DriverManager.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:
|
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 more information on JDBC Monitor, consult Borland's DataGateway Online User's Guide, available from the DataGateway group when DataGateway is installed.
Selecting 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.
Selecting the Output control displays a menu of options for handling the current contents of the data stream.
To monitor database connections at run time, a MonitorButton or a MonitorPanel must be included with the application. MonitorButton is a Java bean which allows you to run the JDBC monitor against a running application. To do so, the instance of the JDBC monitor in use must be brought up by the application. The MonitorButton provides an API so that you can specify which connection to monitor while in design mode. An instance of the JDBC Monitor brought up from the IDE will only monitor database activities during design time.
The MonitorPanel can be used to place the monitor directly on a form. It has the same properties as the MonitorButton.
You could instead edit the file \JBuilder\bin\palette.ini. Add the following line to the section [Palette_Page3] (the Data Express page):
lib\jbcl.zip,borland.sql.monitor.MonitorButton=*
MonitorButton monitorButton1 = new borland.sql.monitor.MonitorButton(); this.add(monitorButton1);
Property | Effect |
MonitorURL | If this value is specified, the monitor will start up operating against a specific driver type or alias. The allowed values are:
|
EnableDriver | Boolean to initialize Driver trace on/off |
EnableConnection | Boolean to initialize Connection trace on/off |
EnableResultSet | Boolean to initialize ResultSet trace on/off |
EnableStatement | Boolean to initialize Statement trace on/off |
EnableFetch | Boolean to initialize Fetch trace on/off |