java.lang.Object
org.tentackle.sql.DynamicDriver
- All Implemented Interfaces:
Driver
Loads a JDBC driver dynamically at runtime via a URL.
Because DriverManager will refuse to use a driver not loaded by the system-classloader, we must wrap the URL-loaded driver by such a class.
Because DriverManager will refuse to use a driver not loaded by the system-classloader, we must wrap the URL-loaded driver by such a class.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsURL(String url) connect(String url, Properties info) intintgetPropertyInfo(String url, Properties info) booleanstatic DriverLoads a JDBC driver dynamically.
The name consists of the driver's classname, followed by a colon, followed by the URL to load it.
Example:static voidUnloads the driver.
-
Method Details
-
load
Loads a JDBC driver dynamically.
The name consists of the driver's classname, followed by a colon, followed by the URL to load it.
Example:org.postgresql.Driver:jar:file:/usr/share/java/postgresql.jar!/
- Parameters:
name- the driver classname and loading url- Returns:
- the loaded driver, never null
-
unload
Unloads the driver.- Parameters:
driver- the driver previously loaded viaload(String)
-
connect
- Specified by:
connectin interfaceDriver- Throws:
SQLException
-
acceptsURL
- Specified by:
acceptsURLin 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
-