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...

Explain the sequence of steps to connect to the database?

Answer Posted / william

An alternate, and preferred way, to using the DriverManager class is to use a DataSource object.

1. The data source is registered on the server side, which stores connection information, like: host, port, sid, credentials (optional), driver to use, etc.

2. The application gets a handle on the data source through a JNDI lookup.

3. The DataSource object is a connection factory and you can invoke .getConnection()

One of the reasons it is preferred over the DriverManager is because it is more flexible. The connection information is taken out of the code, therefore if changes need to be made - such as the machine the db resides on, the driver, etc - the application does not have to be recompiled and redeployed.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of jdbc?

1045


Explain what should be done when a SQL exception is raised?

973


Briefly tell about the jdbc architecture.

999


How do I retrieve a whole row of data at once, instead of calling an individual ResultSet.getXXX method for each column?

1061


DB2 Universal claims to support JDBC 2.0, But I can only get JDBC 1.0 functionality. What can I do?

971


What is use of connection pooling?

964


How to know howmuch data is truncated?

2369


What is the use of JDBC DriverManager class?

1075


Can I use JDBC to execute non-standard features that my DBMS provides?

1013


What is jdbc connection interface?

1021


What is the execute method in java?

1020


What is jdbc and why is it required?

926


How java can be connected to a database?

1107


What is jdbc driver manager?

947


What causes the "No suitable driver" error?

1063