Answer Posted / raghavendra desai
when the Class.forName("oracle.jdbc.driver.OracleDriver) is
executed, the driver calss will be loaded if it was not
loaded earlier. As soon as the class is loaded the static
block will be executed. In the static block the JDBC driver
vendors are responsible for providing the static block in
the driver class. In static block they would have been
written the similar kind of code.
public class oracle.jdbc.driver.OracleDriver implements
Driver
{
static
{
Driver drv= new oracle.jdbc.driver.OracleDriver();
DriverManager.registerDriver(drv)
-----
-----
some other code
}
}
| Is This Answer Correct ? | 36 Yes | 3 No |
Post New Answer View All Answers
What is the purpose of the notify() method?
int x=5,i=1,y=0; while(i<=5) { y=x++ + ++x; i=i+2; } System.out.println(x); System.out.println(y); System.out.println(i); How to solve this? Please explain!
What is JTS?
what is an isolation level?
Where can I find seam examples and documentation?
how to use debug in my elipse to solve problems that exist in my project
What are the different approaches to represent an inheritance hierarchy?
What method is invoked to cause an object to begin executing as a separate thread?
How substring() method of string class create memory leaks?
How messaging services are done, before release of JMS?
what are getters and setters in Java with examples?
How can I scroll through list of pages like the search results in google?
What is message driven beam?
What is a class loader?
Is there a guarantee of uniqueness for entity beans?