This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The problem with using new my.DbDriver() versus Class.forName("my.DbDriver") is that sometimes it encourages people to try to manually register the Driver with the DriverManager, and this is the wrong thing to do. If you do that then it is possible to register a Driver twice. This may not be an immediate problem, but if you try to deregister the Driver, one copy will still be held by the DriverManager. Unlikely, but why risk it if you don't have to. I find it's better to find a template for JDBC operations to follow. This includes using Class.forName(...) then getting all Connections from the DriverManager. Dave
Joined: Jun 13, 2003
thanks dave, i know that using the Class.forName() is the right way but I was just asking whether it was possible? From your reply I guess it is.