SlideShare una empresa de Scribd logo
1 de 3
Connection Pool
•
•
•
•
•
•
•
•
•
•

A connection pool is a cache of database connections (connection objects) maintained in the database’s
memory so that the connection can be reused when the database receives future requests for data.
Connection pools are used to improve the perfomance of executing the commands on a database.
Opening and maintaining a database connection for each user, especially requests made to a dynamic
database-driven website application is costly and wastes resources.
Once the connection is created, it is placed in the pool and it is used over again so that a new connection
does not have to be established.
If all the connections are used up a new connection is made and is added to the pool.
The connection to be established is data store dependent; therefore, the time to be consumed while
opening or closing a connection differes in different databases, such as Oracle, MySql, and SQLServer.
Opening or closing a data store session increases load on the database, which affects the availability and
performance of the application.
In addition, opening closing a session(connection) to data store is a resoure consuming process.
To solve all these problems, the pooling mechanism is used to establish connections before the clients
makes a request.
In other words, the connection objects created to represent the session established to the data store
pooled and recycled for further use.
This mechanism is known as connection pooling in which a connection is retrieved from the pool, used by
an application, and then returned to the pool. The pool contains the objects of the physical connections.
Classes and interfaces
•
•
•
•

ConnectionPoolDataSource
PooledConnection
ConnectionEvent
ConnectionEvenListener

Más contenido relacionado

Más de myrajendra (20)

Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 
Properties
PropertiesProperties
Properties
 
Java.sql package
Java.sql packageJava.sql package
Java.sql package
 

Connection pool

  • 2. • • • • • • • • • • A connection pool is a cache of database connections (connection objects) maintained in the database’s memory so that the connection can be reused when the database receives future requests for data. Connection pools are used to improve the perfomance of executing the commands on a database. Opening and maintaining a database connection for each user, especially requests made to a dynamic database-driven website application is costly and wastes resources. Once the connection is created, it is placed in the pool and it is used over again so that a new connection does not have to be established. If all the connections are used up a new connection is made and is added to the pool. The connection to be established is data store dependent; therefore, the time to be consumed while opening or closing a connection differes in different databases, such as Oracle, MySql, and SQLServer. Opening or closing a data store session increases load on the database, which affects the availability and performance of the application. In addition, opening closing a session(connection) to data store is a resoure consuming process. To solve all these problems, the pooling mechanism is used to establish connections before the clients makes a request. In other words, the connection objects created to represent the session established to the data store pooled and recycled for further use. This mechanism is known as connection pooling in which a connection is retrieved from the pool, used by an application, and then returned to the pool. The pool contains the objects of the physical connections.