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
How can I avoid validating a form before data is entered?
What are various types of class loaders used by jvm?
How task's priority is used in scheduling?
What is threadfactory?
What class is used to create Server side object ?
What is the difference between a static and a non-static inner class?
What is the difference between the font and fontmetrics classes?
Explain what is orm?
What is the difference between system.out ,system.err and system.in?
Can constructors be synchronized in java?
Explain how will the struts know which action class to call when you submit a form?
What is the relationship between local interfaces and container-managed relationships?
Which characters may be used as the second character of an identifier, but not as the first character of an identifier?
Define the remote object implementation?
Difference between DurableSubscription and non- DurableSubscription?