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 is the boot?

530


How do I limit the number of oracle database connections generated by weblogic server? : BEA Weblogic

517


What is error ora-6502? : BEA Weblogic

508


What is the name of default jvm that is made used for weblogic?

572


What Is The Advantage Of Clustering ?

559






What Are The Various Types Of Weblogic Installations ?

653


What is the easiest way to set the classpath ?

592


Explain the performance tuning in jdbc?

559


How do I create a producer pool? : BEA Weblogic

567


In a web logic server what is the domain?

534


What is meant by thread dump and how can we take?

529


What are the various causes for out of memory?

550


What are the toolbar elements.

571


How is the logging implementation specified in web logic?

613


What is the difference between the sun jvm and bea jrockit jvm?

578