what exactly happens when we execute
"Class.forname("Driver class name");"?Explain indetail

Answer Posted / sudhakar

By the end of the execution of Class.forName("Driver
class"); the driver class should be loaded into the memory
but also
1. The driver class should be initialized
2. Should be registered with the driver manager class
The above two operations are not done by forName() . So a
pure Static() block is defined in which the above two tasks
are manipulated and by which we are able to get connection,
immediately after loading the driver class without writing
any code to initialize the driver class.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to retrieve warnings in jdbc?

695


What are the flow statements of jdbc?

708


What is ojdbc?

689


What are the steps required to execute a query in jdbc?

683


What is the benefit of having jdbcrowset implementation?

701






What is ODBC and JDBC? How do you connect the Database?

713


Describe how the jdbc application works.

695


What is resultset in jdbc with example?

656


What is jdbc in java?

642


What is drivermanager in java?

670


In which ways is driver class is registered with drive manager?

698


Explain the difference between inner and outer join ?

679


What is @entity in java?

682


What class.forname does, while loading the drivers?

682


Why do we use jdbc?

667