what is connection pooling?

Answer Posted / m.m.reddy

A group of objects is called as a pool of objects. Object
pooling technique is used mainly to deal with the objects
that are expensive to create.An application using object
pooling technique follows the steps given below.
1).An application creates n'number of objects and places
these objects in the pool(assume n=10).
2).If the application has to use an object it picks up the
objects from the pool, uses the objects and returns the
objects to the pool(the objects return to the pool can be
reused)
3).At any point of time, if the number of objects are
available is not enough the application can add few more
objects to the pool.This is called as expanding the pool.
If there are more objects in the pool(100)but most of the
time a maximum upto 15 objects are used than the
application can be removed upto 90 objects from the pool.
This is called as SHRINKING the pool.
DriverManager.getConnection method establishes the
connection with the server and creates a connection object.
This operation is expensive(takes more amount of time).
When the connection is created using
DriverManager.getConnection calling con.close() closes the
connection.
As the creation of connection object is a expensive it is
recommanded to use connection pooling technique.
The J2EE servers like weblogic,JBoss,websphere etc manages
the connection pool as their own.

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the JDBC Architecture?

570


How to check jdbc driver version in websphere?

553


What is jdbc odbc bridge in java?

542


What is jdbc template?

525


Does jdbc use odbc?

506






How many jdbc driver types are there?

485


What is the major difference between java.util.date and java.sql.date data type?

494


What are different types of JDBC Drivers?

536


Is it possible to connect to multiple databases simultaneously?

558


What are the types of jdbc drivers that exist?

543


When does the result for an sql statement return null?

517


What are the basic exceptions in jdbc?

530


What is a java driver?

504


What is a JDBC 2.0 DataSource?

566


What is the meaning of connection?

533