|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ckkloverdos.db.DbUtil
public final class DbUtil
DB-related utility methods.
Method Summary | |
---|---|
static java.sql.Driver |
registerDriver(java.lang.String className)
Registers the JDBC driver implemented by the class having the provided className . |
static java.sql.Driver |
registerDriver(java.lang.String className,
java.lang.ClassLoader cl)
Registers the JDBC driver implemented by the class having the provided className . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.sql.Driver registerDriver(java.lang.String className) throws java.sql.SQLException
className
.
The context class loader is used to load the class.
className
-
java.sql.SQLException
registerDriver(String, ClassLoader)
public static java.sql.Driver registerDriver(java.lang.String className, java.lang.ClassLoader cl) throws java.sql.SQLException
className
.
The provided class loader is used to load the class.
Note that according to the Javadocs, in order for the driver to be accessible by DriverManager
,
the same class loader as the one that loaded the application/applet is used. This causes
problems in the case we have dynamically loaded our driver by using, for instance, a
CompositeClassLoader
. In order to overcome the inconvenience,
the implementation of this method uses dynamic proxies
.
className
- cl
-
java.sql.SQLException
DriverInvocationHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |