fyi,
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
http://jcp.org/en/jsr/detail?id=221
thanks,
Amit
[EMAIL PROTECTED] 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()?