Package org.apache.drill.jdbc.proxy
Class TracingProxyDriver
java.lang.Object
org.apache.drill.jdbc.proxy.TracingProxyDriver
- All Implemented Interfaces:
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.Driveris the fully qualified name of the driver class to proxy and trace (used to load the class to get it registered with JDBC'sDriverManager, when or in case it's not already loaded) and can be blank if the driver class will already be loaded, and -
original_URLis 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
TracingProxyDriverwill 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").
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsURL(String url) connect(String url, Properties info) intintgetPropertyInfo(String url, Properties info) boolean
-
Constructor Details
-
TracingProxyDriver
- Throws:
SQLException
-
-
Method Details
-
acceptsURL
- Specified by:
acceptsURLin interfaceDriver- Throws:
SQLException
-
connect
public Connection connect(String url, Properties info) throws org.apache.drill.jdbc.proxy.ProxySetupSQLException -
getPropertyInfo
- Specified by:
getPropertyInfoin interfaceDriver- Throws:
SQLException
-
getMajorVersion
public int getMajorVersion()- Specified by:
getMajorVersionin interfaceDriver
-
getMinorVersion
public int getMinorVersion()- Specified by:
getMinorVersionin interfaceDriver
-
jdbcCompliant
public boolean jdbcCompliant()- Specified by:
jdbcCompliantin interfaceDriver
-
getParentLogger
- Specified by:
getParentLoggerin interfaceDriver- Throws:
SQLFeatureNotSupportedException
-