Package io.github.jdbcx
Class WrappedDriver
java.lang.Object
io.github.jdbcx.WrappedDriver
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsURL(String url) connect(String url, Properties info) voidprotected DrivergetActualDriver(String url, Properties props) Gets the actual driver.protected DriverExtensiongetDriverExtension(String url) intintgetPropertyInfo(String url, Properties info) booleanprotected StringnormalizeUrl(DriverExtension extension, String url)
-
Constructor Details
-
WrappedDriver
public WrappedDriver()
-
-
Method Details
-
getDriverExtension
-
normalizeUrl
-
getActualDriver
Gets the actual driver.- Parameters:
url- normalized JDBC connection URLprops- PRQL related properties- Returns:
- actual driver
- Throws:
SQLException- when failed to get the actual driver
-
acceptsURL
- Specified by:
acceptsURLin interfaceDriver- Throws:
SQLException
-
connect
- Specified by:
connectin interfaceDriver- Throws:
SQLException
-
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
-
deregister
public void deregister()- Specified by:
deregisterin interfaceDriverAction
-