Every driver instance has one and only one monitor instance associated with it. The initial monitor for the default driver instance that is implicitly registered with the DriverManager has no logging/tracing enabled. Enabling tracing for the default driver is not recommended. However, if you create your own driver instance, you can tailor the tracing and logging for your driver without affecting the default driver registered with the DriverManager.
The following example shows calls to getMonitor() trace methods:
//Open the driver manager's log stream DriverManager.setLogStream(System.out); //Create the driver object java.sql.Driver icDriver = new interbase.interclient.Driver(); //Trace method invocations by printing messages to this monitor's //trace stream ((interbase.interclient.Driver)icDriver).getMonitor().setTraceStream (System.out); ((interbase.interclient.Driver(icDriver).getMonitor().enableAllTraces (true);After running the program and executing some SQL statements, you can print out the trace messages associated with the driver, connection, and statement methods. The tracing output distinguishes between implicit calls, such as the garbage collector or InterClient driver calling close() vs. user-explicit calls. This can be used to test application code, since it would show if result sets or statements aren't being cleaned up when they should.