Class TracingProxyDriver

java.lang.Object
org.apache.drill.jdbc.proxy.TracingProxyDriver
All Implemented Interfaces:
Driver

public class TracingProxyDriver extends Object implements Driver
Proxy driver for tracing calls to a JDBC driver. Reports calls and parameter values to, and return values and exceptions from, methods defined by JDBC interfaces.

Invocation:

To set up a tracing version of a JDBC connection:

  • Construct the proxying URL corresponding to the original URL.

    The proxying URL corresponding to an original URL is "jdbc:proxy:original.Driver:original_URL", where:

    • original.Driver is the fully qualified name of the driver class to proxy and trace (used to load the class to get it registered with JDBC's DriverManager, when or in case it's not already loaded) and can be blank if the driver class will already be loaded, and
    • original_URL is the original URL for the JDBC data source to now be traced.

    For example, for an original URL of "jdbc:drill:zk=local", the tracing URL is "jdbc:proxy:org.apache.drill.jdbc.Driver:jdbc:drill:zk=local".

  • In the JDBC-client code or tool, replace the occurrence of the original URL with the corresponding proxying URL.
  • Make sure that class TracingProxyDriver will be loaded (e.g., configure the client to use it as the driver class).

Output:

Currently, the tracing output lines are simply written to System.out (stdout or "standard output").