What are the steps in connecting to database?

Answer Posted / sanket pandit

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

This is for SQ L Ans.
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 in

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which parameter of ConnectionString is used to specify the name of the database?

767


Explain executenonquery?

784


Does sqlclient and oledb class share the same functionality?

704


What is the default timeout specified for "sqlcommand.commandtimeout" property?

743


What is connection in ado.net?

699


What is shadow copy?

748


What is Serialization in .NET? what are the types of Serialization?

749


What is ado.net architecture?

664


What is ado.net full form?

730


Explain ado.net features?

764


Can you explain how to enable and disable connection pooling?

706


Explain the basic use of "dataview" and explain its methods.

695


What is sql connection in ado.net?

683


What is execute reader in ado.net?

682


I loaded the dataset with a table of 10 records. One of the records is deleted from the backend, how do you check whether all the 10 records were present while updating the data(which event and steps) and throw the exception 28 can datareader hold data from multiple tables?

754