Is there any other way to load the driver other than Class.forName() ?
Printable View
Is there any other way to load the driver other than Class.forName() ?
class.forName() is valid for any class object instatiation at run time, you can create a static object of particular driver type & can continue with the same:)
Alternative way is by creating Driver object
Driver d=new foo.bar.MyDriver();
//here "foo.bar" is an third party that may be mysql or orcale.
Connection con=d.Connect();
The best way is using class.forName() because we can use more than 1 driver in this case, but by using Driver object we can use only one particular driver.