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 EJB and other Java EE Technologies and the fly likes javax.sql.DataSource and javax.sql.ConnectionPoolDataSource 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 » Java » EJB and other Java EE Technologies
Bookmark "javax.sql.DataSource and javax.sql.ConnectionPoolDataSource" Watch "javax.sql.DataSource and javax.sql.ConnectionPoolDataSource" New topic

javax.sql.DataSource and javax.sql.ConnectionPoolDataSource

Arun Kandregula

Joined: Dec 19, 2005
Posts: 26
When creating a connection pool in Glassfish, I am confused with these two options:
javax.sql.DataSource and javax.sql.ConnectionPoolDataSource.

What is the difference between javax.sql.DataSource and javax.sql.ConnectionPoolDataSource ?

I thought every implementation of javax.sql.DataSource supports connection pooling. ( Not just javax.sql.ConnectionPoolDataSource )

Also, I read somewhere that some app servers like Glassfish will use ConnectionPoolDataSource regardless and expose just DataSource.

If we close the connection returned by (getConnection() of javax.sql.DataSource), wont that go back to connection pool ?

Let me put it this way :

What is the necessity of having javax.sql.ConnectionPoolDataSource, when javax.sql.DataSource itself supports pooling.
Am I assuming anything? Will every app server implements DataSource such a way that is supports pooling? Yes/No ?

Arun Kumar Kandregula.
SCBCD 1.3 92%
SCJP 1.4 98%
I agree. Here's the link:
subject: javax.sql.DataSource and javax.sql.ConnectionPoolDataSource
Similar Threads
Trying to set up Connection Pooling using Glassfish
using datasource - connection pooling
EJB & JPA Unexpected Results
connection pooling implementation
How to get the DataSource Object in the servlet