db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: Autoloading of JDBC drivers considered harmful?
Date Tue, 30 May 2006 14:49:51 GMT
Knut Anders Hatlen wrote:

> Another issue with Derby and autoloading is that it only happens once
> per JVM. If you do a getConnection("jdbc:derby:;shutdown=true"), the
> driver is unloaded and won't be reloaded unless you do a
> Class.forName(). So this code
>   Connection c = DriverManager.getConnection("jdbc:derby:mydb");
>   doSomethingWithConnection(c);
>   try {
>     DriverManager.getConnection("jdbc:derby:;shutdown=true");
>   } catch (SQLException) { /* shutdown exception */ }
> runs fine the first time it is executed, but if it is executed later
> within the same JVM, it fails with "no suitable driver".

Is this special to Derby, or is it true for any JDBC driver?

Do other drivers provide the ability to de-register themselves from the
DriverManager? Or can an application just call?



View raw message