What is the role of Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") in my application?

Questions by saipadma

Showing Answers 1 - 5 of 5 Answers

Amita Vaish

  • Apr 25th, 2006
 

class.forName("sun.jdbc.odbc.JdbcOdbcDriverclass)

the role is that

to load JDBC driver class.

  Was this answer useful?  Yes

radhey

  • Apr 25th, 2006
 

it's not load the driver,it check the driver it is valid or not.Driver loaded by the java virtual machine(JVM)not by the class.forName("driver name").

  Was this answer useful?  Yes

guna ms

  • Apr 27th, 2006
 

class.forName(sun.jdbc.odbc.jdbcodbcDriver) the purpose of this is to load the data base Driver into the RAM and to register with that.

  Was this answer useful?  Yes

sriaknth

  • May 15th, 2006
 

when we call forName() method on Class class what happen is1)initially the class is loaded into the memory2)then it calls the static method forName()3)the static forName() method contains a static block.That static block regiser the loaded driver class with the DriverManager class

  Was this answer useful?  Yes

vijaybharti

  • Jul 18th, 2006
 

it is used to load the class at runtime and in jdbc it is used to load the driver and according to specification every driver class must contain a static block in which it contains the code to instanciate itself and the register itself with the driver manager.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions