What is the difference between Connection Pool and data source?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / hitler
The Connection pool means equals instance of connections and
it refereed Data Source object.
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / vijaya kumar
DataSource is an object reference which provides jdbc client to obtain a connection from connection pool.
Connection Pool is collection of ready to use database connections to connect the database.
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / raju
Connection pool is an mechanism of pre-creating group of connections and keeping them in cache memory for use and reuse.
DataSource is an interface in javax.sql ackage.Datasource is nothing but object oriented representation of connection pool or DataSource can be called as connection factory.
Coming to DataSource implementations some third parties have implemented this datasource and also server vendors like Tomcat,Websphere also implemented.
NOTE:mostly we use the server implemented DataSources
| Is This Answer Correct ? | 1 Yes | 0 No |
What Are The Various Types Of Weblogic Installations ?
What is the linux command is used to know the version of weblogic server?
How many weblogic severs can be installed in a multi cpu machince and how can you figure out how many servers?
How to set Connection Pool size in Weblogic Server ?
how to enable conection poole shrinking??
Explain the functionality of T3 associated with WebLogic server?
How does cluster communication happen?
How to write a program of web logic server to get the connection pool attribute?
Do you know what are the steps required to modify config.xml file of web logic server?
How to delete connection pool?
Why do I get an error while trying to retrieve the text for ora-12705? : BEA Weblogic
when i am starting my managed server it is coming to admin state.I used to click on resume button in admin console , so that it is comming to running state. How to resolve this problem for ever so that the server will come directly to running state instead of going to admin state?