db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Handa <Amit.Ha...@Sun.COM>
Subject Re: derby jdbc load driver
Date Wed, 10 Aug 2005 09:07:29 GMT
We are moving away from the approach of doing a Class.forName() in apps 
from JDBC 4.0 onwards
if you package your driver as a service(according to Jar Spec).

You can go through the Spec Early Draft Review available at 


Oyvind.Bakksjo@Sun.COM wrote:

> Satheesh Bandaram wrote:
>> I think Derby recommends using *.newInstance()* to load JDBC 
>> drivers... In fact, it is required if you plan to shutdown and reboot 
>> databases on the same thread/VM for Derby. Take a look at the javadoc 
>> for EmbeddedDriver.
> Ok. But if Derby recommends it, then it should be explicitly mentioned 
> in the manuals (both in the Reference and the Developer's Guide), 
> which it isn't:
> http://db.apache.org/derby/docs/10.1/devguide/cdevdvlp40653.html
> http://db.apache.org/derby/docs/10.1/ref/rrefjdbc32052.html
> Instead, there are contradicting statements like the one below:
> ---------------
> * Class.forName("org.apache.derby.jdbc.EmbeddedDriver")
> Our recommended manner, because it ensures that the class is loaded in 
> all JVMs by creating an instance at the same time.
> ---------------
> What instance? Since there is no .newInstance() here, this can be 
> understood as if the class has a static initializer which creates an 
> instance of the class. And if so, why should the application do 
> .newInstance()?

View raw message