What is the use of Class.forName

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


Please Help Members By Posting Answers For Below Questions

when A client sent a request to the server to open facebook page and close the browser after this request .at that time the same user do login by using a different browser then that session id will exist or not for the same client??

1110


Can constructors be synchronized in java?

623


What is the purpose of the notifyall() method?

613


Explain ioc concept?

628


Can I map more than one table in a cmp?

596






we use MainFrame and using os390 for operating system with DB2 data base in IRAN and interest programing with java and use webspere for world wide,please help me where i should start?

1930


What is a class loader?

591


What restrictions are placed on the location of a package statement within a source code file?

622


Name three subclasses of the component class?

619


What is colon_pkg_prefixes and what is its use?

1999


What are the difference between RMI and CORBA?

623


whats is mean by tiles in struts

1626


Is the session factory thread safe?

679


Explain the different types of memory used by jvm?

614


To what value is a variable of the string type automatically initialized?

615