Package de.willuhn.datasource.db
Class MyDriver
- java.lang.Object
-
- de.willuhn.datasource.db.MyDriver
-
- All Implemented Interfaces:
java.sql.Driver
public class MyDriver extends java.lang.Object implements java.sql.Driver
Hilfsklasse da java.sql.DriverManager nur Driver akzeptiert, die vom Systemclassloader geladen worden. Siehe: http://www.kfu.com/~nsayer/Java/dyn-jdbc.html Sprich: Bringt zum Beispiel ein Jameica-Plugin eigene JDBC-Treiber mit, wuerde java.sql.DriverManager die nicht haben wollen, weil sie nicht vom System-Classloader kommen. Daher zimmern wir uns einen Wrapper um den eigentlichen Driver. Hauptsache MyDriver ist vom SystemClassloader geladen. Wo der tatsaechliche Treiber herkommt, interessiert den DriverManager nicht ;).
-
-
Constructor Summary
Constructors Constructor Description MyDriver(java.lang.String driverClass, java.lang.ClassLoader loader)
ct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsURL(java.lang.String url)
java.sql.Connection
connect(java.lang.String url, java.util.Properties info)
int
getMajorVersion()
int
getMinorVersion()
java.util.logging.Logger
getParentLogger()
java.sql.DriverPropertyInfo[]
getPropertyInfo(java.lang.String url, java.util.Properties info)
boolean
jdbcCompliant()
-
-
-
Method Detail
-
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersion
in interfacejava.sql.Driver
- See Also:
Driver.getMajorVersion()
-
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersion
in interfacejava.sql.Driver
- See Also:
Driver.getMinorVersion()
-
jdbcCompliant
public boolean jdbcCompliant()
- Specified by:
jdbcCompliant
in interfacejava.sql.Driver
- See Also:
Driver.jdbcCompliant()
-
acceptsURL
public boolean acceptsURL(java.lang.String url) throws java.sql.SQLException
- Specified by:
acceptsURL
in interfacejava.sql.Driver
- Throws:
java.sql.SQLException
- See Also:
Driver.acceptsURL(java.lang.String)
-
connect
public java.sql.Connection connect(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
- Specified by:
connect
in interfacejava.sql.Driver
- Throws:
java.sql.SQLException
- See Also:
Driver.connect(java.lang.String, java.util.Properties)
-
getPropertyInfo
public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info) throws java.sql.SQLException
- Specified by:
getPropertyInfo
in interfacejava.sql.Driver
- Throws:
java.sql.SQLException
- See Also:
Driver.getPropertyInfo(java.lang.String, java.util.Properties)
-
getParentLogger
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
- Specified by:
getParentLogger
in interfacejava.sql.Driver
- Throws:
java.sql.SQLFeatureNotSupportedException
- Since:
- Java 7
- See Also:
Driver.getParentLogger()
-
-