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.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'sDriverManager
, 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").
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
acceptsURL
(String url) connect
(String url, Properties info) int
int
getPropertyInfo
(String url, Properties info) boolean
-
Constructor Details
-
TracingProxyDriver
- Throws:
SQLException
-
-
Method Details
-
acceptsURL
- Specified by:
acceptsURL
in interfaceDriver
- Throws:
SQLException
-
connect
public Connection connect(String url, Properties info) throws org.apache.drill.jdbc.proxy.ProxySetupSQLException -
getPropertyInfo
- Specified by:
getPropertyInfo
in interfaceDriver
- Throws:
SQLException
-
getMajorVersion
public int getMajorVersion()- Specified by:
getMajorVersion
in interfaceDriver
-
getMinorVersion
public int getMinorVersion()- Specified by:
getMinorVersion
in interfaceDriver
-
jdbcCompliant
public boolean jdbcCompliant()- Specified by:
jdbcCompliant
in interfaceDriver
-
getParentLogger
- Specified by:
getParentLogger
in interfaceDriver
- Throws:
SQLFeatureNotSupportedException
-