Hi SUJITH SUNIL KANAPARTHI
Class.forName(jdbc
dbc:YourDriver) actually work this way:
YourDriver is a class which has a static block in that static block you are creating the instance of YourDriver class which in turn will call the DriverManager.registerDriver and hence will get registerd with the DriverManager as DriverManager maintains the list of all the drivers registered with it.
Something like this
class YourDriver implements Driver
{
static
{
YourDriver d = new YourDriver();
DriverManager.registerDriver(d);
}
}
Instead of writing Class.forName(jdbc
dbc:YourDriver) you can also write a command on the command prompt like this
jdbc.drivers = jdbc
dbc:YourDriver :jdbc
dbc:YourDriver2:jdbc
dbc:YourDriver3
and so on by this you are actually adding the Drivers to the java.lang.System property so when the DriverManager class is intialized it looks for jdbc.drivers if user has entered drivers then it will load them, by this you can specify more then one driver seprated with :
I hope this will help
Take care
Rashi