Package io.github.jdbcx

# Class WrappedDriver

java.lang.Object
io.github.jdbcx.WrappedDriver

All Implemented Interfaces:
  `Driver`, `DriverAction`

public class WrappedDriver extends Object implements Driver, DriverAction
This class is essentially a wrapper of the `Driver` interface. It accepts a connection string that starts with `jdbcx:`, followed by an optional name of a `DriverExtension`, which defines the default behaviors of the driver. For example, in the JDBC driver, we used to use `jdbc:mysql://localhost/test` to connect to MySQL. However, now it has changed to `jdbcx:mysql://localhost/test` or `jdbcx:prql:mysql://localhost/test`, if you prefer to use PRQL.

## Constructor Summary

Constructors
Constructor
Description
`WrappedDriver()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`acceptsURL(String url)`
`Connection`
`connect(String url, Properties info)`
`void`
`deregister()`
`protected Driver`
`getActualDriver(String url, Properties props)`
Gets the actual driver.
`protected DriverExtension`
`getDriverExtension(String url)`
`int`
`getMajorVersion()`
`int`
`getMinorVersion()`
`Logger`
`getParentLogger()`
`DriverPropertyInfo[]`
`getPropertyInfo(String url, Properties info)`
`boolean`
`jdbcCompliant()`
`protected String`
`normalizeUrl(DriverExtension extension, String url)`

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

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

## Constructor Details

### WrappedDriver

public WrappedDriver()

## Method Details

### getDriverExtension

protected DriverExtension getDriverExtension(String url)

### normalizeUrl

protected String normalizeUrl(DriverExtension extension, String url)

### getActualDriver

protected Driver getActualDriver(String url, Properties props) throws SQLException
Gets the actual driver.

Parameters:
  `url` - normalized JDBC connection URL
  `props` - PRQL related properties
Returns:
  actual driver
Throws:
  `SQLException` - when failed to get the actual driver

### 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 SQLException

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

### 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`

### deregister

public void deregister()

Specified by:
  `deregister` in interface `DriverAction`