Package org.apache.drill.jdbc.proxy

# 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").

## Constructor Summary

Constructors
Constructor
Description
`TracingProxyDriver()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`acceptsURL(String url)`
`Connection`
`connect(String url, Properties info)`
`int`
`getMajorVersion()`
`int`
`getMinorVersion()`
`Logger`
`getParentLogger()`
`DriverPropertyInfo[]`
`getPropertyInfo(String url, Properties info)`
`boolean`
`jdbcCompliant()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TracingProxyDriver

public TracingProxyDriver() throws SQLException

Throws:
  `SQLException`

## Method Details

### acceptsURL

public boolean acceptsURL(String url) throws SQLException

Specified by:
  `acceptsURL` in interface `Driver`
Throws:
  `SQLException`

### connect

public Connection connect(String url, Properties info) throws org.apache.drill.jdbc.proxy.ProxySetupSQLException

Specified by:
  `connect` in interface `Driver`
Throws:
  `org.apache.drill.jdbc.proxy.ProxySetupSQLException`

### getPropertyInfo

public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException

Specified by:
  `getPropertyInfo` in interface `Driver`
Throws:
  `SQLException`

### getMajorVersion

public int getMajorVersion()

Specified by:
  `getMajorVersion` in interface `Driver`

### getMinorVersion

public int getMinorVersion()

Specified by:
  `getMinorVersion` in interface `Driver`

### jdbcCompliant

public boolean jdbcCompliant()

Specified by:
  `jdbcCompliant` in interface `Driver`

### getParentLogger

public Logger getParentLogger() throws SQLFeatureNotSupportedException

Specified by:
  `getParentLogger` in interface `Driver`
Throws:
  `SQLFeatureNotSupportedException`