Content deleted Content added
Adding local short description: "Link between a client and database server", overriding Wikidata description "means by which a database server and its client software communicate with each other" |
|||
(45 intermediate revisions by 34 users not shown) | |||
Line 1:
{{Short description|Link between a client and database server}}
{{no inline sources|date=July 2025}}
A '''database connection''' is a facility in [[computer science]] that allows [[Client (computing)|client]] software to talk to [[database server]] software, whether on the same machine or not. A '''connection''' is required to send [[command (computing)|commands]] and receive answers, usually in the form of a result set.
Connections are a key concept in [[data-centric]] programming. Since some
Connections are built by supplying an underlying [[software driver|driver]] or [[
▲Connections are a key concept in [[data-centric]] programming. Since some [[Database|DBMSs]] require considerable time to connect, [[connection pooling]] is used to improve performance. No command can be performed against a database without an "open and available" connection to it.
▲Connections are built by supplying an underlying [[software driver|driver]] or [[provider model|provider]] with a [[connection string]], which is used to address a specific [[database]] or [[server (computing)|server]] and to provide instance and user authentication credentials (for example, <code>'''Server='''sql_box;'''Database='''Common;'''User ID='''uid;'''Pwd='''password;</code>).
▲Some databases, such as [[PostgreSQL]], only allow one operation to be performed at a time on each connection.{{citation needed|date=September 2012}} If a request for data (a [[SQL]] [[Select (SQL)|Select]] statement) is sent to the database and a [[result set]] is returned, the connection is open but not available for other operations until the client finishes consuming the result set.
== Pooling ==
Database connections are
[[Connection pool
The connection object obtained from the connection pool is often a
This approach encourages the practice of opening a connection in an application only when needed, and closing it as soon as the work is done, rather than holding a connection open for the entire life of the application. In this manner, a relatively small number of connections can service a large number of requests. This is also called [[multiplexing]].
In a
An application failure occurs when the connection pool overflows. This can occur if all of the connections in the pool are in use when an application requests a connection. For example, the application may use a connection for too long when too many clients attempt to access the web site or one or more operations are blocked or simply inefficient.
== See also ==
* [[ActiveX Data Objects|ADO]]
* [[ADO.NET]]
* [[ODBC|ODBC (Open Database Connectivity)]]
* [[JDBC]]
* [[RDBMS]]
== References ==
* [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataidbconnectionclasstopic.asp IDbConnection Interface on MSDN]
* [https://web.archive.org/web/20080428080316/http://betav.com/blog/billva/2007/05/managing_and_monitoring_net_co.html Managing and Monitoring .NET Connections whitepaper.]
* [https://web.archive.org/web/20080501014734/http://betav.com/blog/billva/2006/06/getting_and_staying_connected_1.html Getting and Staying Connected whitepaper.]
* Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) Addison Wesley, William Vaughn, {{ISBN
▲* Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) Addison Wesley, William Vaughn, ISBN 978-0-321-24362-1
==External links==
* [http://ConnectionStrings.com ConnectionStrings.com]
[[Category:Databases]]
|