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
What is a jdbc driver and how many jdbc drivers are available?
What are the main components of JDBC ?
Explain about DSN?
What is JDBC Connection? Explain steps to get Database connection in a simple java program.
What are the classes and methods used for sending sql statements to database?
Explain about the drive manager class working?
What do you understand by jdbc driver and explain its types?
There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set?
What is jdbc class forname?
What does adapter class provide?
How can I retrieve a String or other object type without creating a new object each time?
What is database deadlock ? How can we avoid them?
What is a jdbc connection string?
Why prepared statements are faster?
Explain how data flows from view to db and reverse