what is connection pooling?

Answer Posted / bhudeep

With servlets, opening a database connection is a major
bottleneck because we are creating and tearing down a new
connection for every page request and the time taken to
create connection will be more.
Creating a connection pool is an ideal approach for
a complicated servlet. With a connection pool, we can
duplicate only the resources we need to duplicate rather
than the entire servlet. A connection pool can also
intelligently manage the size of the pool and make sure each
connection remains valid. A number connection pool packages
are currently available. Some like DbConnectionBroker are
freely available from
Java Exchange Works by creating an object that dispenses
connections and connection Ids on request.
The Connection Pool class maintains a Hastable,
using Connection objects as keys and Boolean values as
stored values. The Boolean value indicates whether a
connection is in use or not. A program calls getConnection
( ) method of the ConnectionPool for getting Connection
object it can use; it calls returnConnection ( ) to give the
connection back to the pool.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between ojdbc6 and ojdbc7?

474


What is statement and resultset in jdbc?

500


How can I retrieve a String or other object type without creating a new object each time?

583


What is use of connection pooling?

525


Name the types of jdbc drivers.

552






How the JDBC application works?

536


What is type 4 jdbc driver?

486


What is addbatch jdbc?

537


what is the meaning of following code snippets Class c=class.forName(driverClassName); Driver d=(driver)c.newInstance();

4339


Name the method, which is used to prepare a callablestatement.

510


What causes no suitable driver error?

546


What is java soft framework?

553


Why should we close database connections in java?

689


What does executeupdate return in java?

499


How can I connect mysql or oracle with java?

554