What is the use of Class.forName

Answer Posted / vivek katta

Class.forName will basically load a class. As part of class loading, static variables
will be initialized and static blocks present in the class will be executed.

This is the concept used in JDBC to register driver(s). A static block in the driver
class gets executed which inturn registers the JDBC driver with the connection
manager.

Is This Answer Correct ?    66 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?

2409


What is colon_pkg_prefixes and what is its use?

2184


Will the general public have access to the infobus apis?

752


What is JTS?

2058


How are commas used in the intialization and iteration parts of a for statement?

796






What is the difference between system.out ,system.err and system.in?

796


What is the purpose of the finally clause of a try-catch-finally statement?

762


which book is better for jdbc ,servlets and jsp

1823


What are JTA/JTS and how they used by client?

1925


What is a clone?

772


Is the ternary operator written x : y ? Z or x ? Y : z ?

834


What is metaspace?

755


Whats new with the stop(), suspend() and resume() methods in jdk 1.2?

772


Is it possible to stop the execution of a method before completion in a sessionbean?

806


difference between  ejb,struts,hibernate,spring and jsp

2550