jQuery in Action, 3rd edition
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
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: http://aspose.com/file-tools
subject: javax.sql.DataSource and javax.sql.ConnectionPoolDataSource
It's not a secret anymore!