This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
javax.sql.DataSource and javax.sql.ConnectionPoolDataSource
posted 6 years ago
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 ?