Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what exactly happens when we execute
"Class.forname("Driver class name");"?Explain indetail

Answer Posted / srinivas.r, -parigi

Class is predefined class and .forName() is the static
method , it is responsiblity of jdbc Driver implementer to
provide a static block as part of the driver class.As part
of this sttic block code will be provided to take care of
registering the driver
EX : --------------****--------
public class Drv implements Driver
{
static{Driver d=new OracleDriver();
DriverManager.register(driver);
}}
----------------*******--------
As the sttic block provided by the driver vender can take
care of registering the driver instance of following code
----------
Driver drv=new Oralce.jdbc.driver.OracleDriver();
DriverManager.registerDriver(driver);
----------
by providing directly
Class.forName("oralce.jdbc.driver.OracleDriver");
the above code will be executed.........All the best.
------- Thank u to providing this facility

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is jdbc in dbms?

1030


What does adapter class provide?

938


Which is better odbc or jdbc?

995


What is the full form of jdbc and what is its purpose?

1004


What is jdbc url for mysql?

1030


Is jdbc and orm?

928


Can resultset be null in java?

924


What is JDBC Batch Processing and what are it’s benefits?

1019


Which type of driver provides jdbc access via one or more odbc drivers?

902


How can we store and retrieve images from the database?

959


How vendor Naming registry supports JNDI?

2196


Why do we use jdbc in java?

1046


What is jdbc and its types?

954


What does jdbc setmaxrows method do?

960


How to connect html page to database using jdbc?

895