What is the difference between Connection Pool and data source?

Answer Posted / jaydeb chakraborty

Applications access a data source using a connection and
access Databases via DataSource objects.

A DataSource has a set of properties that identify and
describe the real world data source that it represents.
These properties include information such as the location
of the database server, the name of the database, the
network protocol to use to communicate with the server, and
so on.
DataSource object can be thought of as a factory for
connections to the particular data source that the
DataSource instance represents. In a basic DataSource
implementation, a call to the getConnection method returns
a connection object that is a physical connection to the
data source.

DataSource objects that implement connection pooling also
produce a connection to the particular data source that the
DataSource class represents. The connection object that the
getConnection method returns is a handle to a
PooledConnection object rather than being a physical
connection. An application uses the connection object in
the same way that it uses a connection. Connection pooling
has no effect on application code except that a pooled
connection, like all connections, should always be
explicitly closed. When an application closes a connection
that is pooled, the connection is returned to a pool of
reusable connections. The next time getConnection is
called, a handle to one of these pooled connections will be
returned if one is available. Because connection pooling
avoids creating a new physical connection every time one is
requested, it can help applications run significantly
faster.

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between a web logic server and a web server?

534


Do ejbs have to be homogeneously deployed across a cluster? Why?

542


In corba, which of the files generated by the idltojava compiler must be compiled before running the server application? : BEA Weblogic

564


Can the messaging bridge forward durable subscription messages between separate weblogic server 6.1 and release 7.0 or later domains? : BEA Weblogic

497


What are class paths?

522






Explain deployment descriptors?

596


What is silent mode?

585


What can happen when stub can’t to connect to web-logic server instances?

515


How to access the admin console?

574


How to troubleshoot and overcome such issues?

555


What is an administration server?

513


How are the notifications generated when a server is added to a cluster?

552


What is weblogic?

616


What is meant by domain?

643


In web logic what is the msi code?

506