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

What is a jdbc driver and how many jdbc drivers are available?

584


What are the main components of JDBC ?

578


Explain about DSN?

541


What is JDBC Connection? Explain steps to get Database connection in a simple java program.

619


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

542






Explain about the drive manager class working?

608


What do you understand by jdbc driver and explain its types?

497


There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set?

618


What is jdbc class forname?

491


What does adapter class provide?

527


How can I retrieve a String or other object type without creating a new object each time?

581


What is database deadlock ? How can we avoid them?

519


What is a jdbc connection string?

466


Why prepared statements are faster?

533


Explain how data flows from view to db and reverse

1635