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.DriverHilfsklasse 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 booleanacceptsURL(java.lang.String url)java.sql.Connectionconnect(java.lang.String url, java.util.Properties info)intgetMajorVersion()intgetMinorVersion()java.util.logging.LoggergetParentLogger()java.sql.DriverPropertyInfo[]getPropertyInfo(java.lang.String url, java.util.Properties info)booleanjdbcCompliant()
-
-
-
Method Detail
-
getMajorVersion
public int getMajorVersion()
- Specified by:
getMajorVersionin interfacejava.sql.Driver- See Also:
Driver.getMajorVersion()
-
getMinorVersion
public int getMinorVersion()
- Specified by:
getMinorVersionin interfacejava.sql.Driver- See Also:
Driver.getMinorVersion()
-
jdbcCompliant
public boolean jdbcCompliant()
- Specified by:
jdbcCompliantin interfacejava.sql.Driver- See Also:
Driver.jdbcCompliant()
-
acceptsURL
public boolean acceptsURL(java.lang.String url) throws java.sql.SQLException- Specified by:
acceptsURLin 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:
connectin 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:
getPropertyInfoin 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:
getParentLoggerin interfacejava.sql.Driver- Throws:
java.sql.SQLFeatureNotSupportedException- Since:
- Java 7
- See Also:
Driver.getParentLogger()
-
-