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

Give an example of code used for setting up connection with a driver.

509


What is database deadlock ? How can we avoid them?

502


How can I use the JDBC API to access a desktop database like Microsoft Access over the network?

523


What is the difference between jdbc and odbc?

518


How do I stop nullpointerexception?

502






What are the jdbc statements?

547


What does the jdbc driver interface do?

544


Is jdbc a framework?

470


What does the jdbc databasemetadata interface?

512


Which jdbc drivers will run your program?

500


What are types of resultset?

546


RowSetInternal caller and returns void. What can I do in the readData method?

536


What are the classes and methods used for sending sql statements to database?

532


Where is jdbc used?

475


What is meant by dao?

510