What is the difference between Class.forName and registerDriver()

Showing Answers 1 - 3 of 3 Answers

MSachin

  • Aug 17th, 2005
 

registerDriver() registers the JDBC driver with the DriverManager class. 
 
Class.forName() first loads the respective driver into the memory, registers the driver with the Driver Manager class and then creates an instance of the driver to carry out the necessary JDBC actions.

  Was this answer useful?  Yes

ruchi

  • Jan 8th, 2006
 

class.forName() is a method ,this method takes a string representing a fully qualified class name(one that includes the package name) and loads the corresponding class.

  Was this answer useful?  Yes

lokanath reddy

  • Oct 25th, 2012
 

class.forName("full qualm name"); is used to load the driver explicitly and DriverManger.registerDriver(new classname()); will implicitly loads the driver automatically

  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