What Class.forName will do while loading drivers?

It is used to create an instance of a driver and register it with the DriverManager. When you have loaded a driver, it is available for making a connection with a DBMS.

Showing Answers 1 - 3 of 3 Answers

Jaime

  • Jul 16th, 2005
 

Dynamic loading of Java classes at runtime provides tremendous flexibility in the development of enterprise systems. It provides for the basis of "application servers", and allows even simpler, lighter-weight systems to accomplish some of the same ends. Within Java, dynamic loading is typically achieved by calling the forName method on the class java.lang.Class; however, when Class.forName is naively called from within an Extension, strange errors can occur. This paper describes why those errors occur, and how Java2 provides two facilities, one a modification to the forName syntax, and the other, called the "Thread context ClassLoader", to avoid them. This paper assumes you are passingly familiar with Java Reflection, and have at least a general idea of what Java ClassLoaders are and how they are used within Java code.  
 
Download the Tutorial 
 
Download Sample Code

  Was this answer useful?  Yes

deepak

  • Sep 24th, 2005
 

class.forName()method create an  instance of specified driver, loads that driver, and then register that driver with the DriverManager class.

  Was this answer useful?  Yes

M.Nithiyanandhan

  • Oct 17th, 2005
 

it is used tom initialize the driver .

  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