This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes DataSource and ConnectionPool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "DataSource and ConnectionPool" Watch "DataSource and ConnectionPool" New topic
Author

DataSource and ConnectionPool

eswar kumar
Ranch Hand

Joined: Oct 20, 2002
Posts: 98
what is the difference between DataSource and ConnectionPool
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Off the top of my head, I'd say:
A Connection Pool is a database-specific implementation of the Broker Pattern. Connection Pools also imply pools that grow or shrink depending on requirements, and have other functionality like making sure the Connections don't become broken or stale. It is designed to manage database Connection resources.
A DataSource is a distributed connection manager. It is designed to serve out out connections to a distributed application from a centralised source. In theory it would respond to connection requests by opening a new Connection and returning it, but in practice they tend to have a Connection Pool hiding behind the scenes as well.
I guess you could view a DataSource as a decorator for a Connection Pool. It decorates the Connection Pool with the ability to be distributed.
Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DataSource and ConnectionPool
 
Similar Threads
Help with connection statement
Data Source in TOMCAT 5.5.4
LAST_INSERT_ID() with threads
DataSource & ConnectionPool
difference between XADatasourca and non-xa datasource