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

What is a sessionfactory? Is it a thread-safe object?

698


Explain phantom read?

1749


AS a developer will u create a data source in connection pool? If so how will u do that, how to access the object from connection pool using IRAD tool?

1654


how i secure my site with the https protocol.what are the steps?

1750


What are the services in RMI ?

1900






how to use debug in my elipse to solve problems that exist in my project

1778


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

595


What is a modular application?

608


What is the diffrence between a local-tx-datasource and a xa-datasource?

595


Explain what is orm?

687


How to pass parameters in RMI?

1701


Describe activation process?

2070


what is a non-repeatable read?

1836


Why does the tag url-encode javascript and mailto links?

595


What restrictions are placed on the values of each case of a switch statement?

547