db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Burlison <Alan.Burli...@sun.com>
Subject What exactly are the *ConnectionPoolDataSource classes for?
Date Tue, 18 Sep 2007 22:51:18 GMT

I'm embedding Derby inside Tomcat, but running it in Server mode so I 
can connect to it externally whilst Tomcat is running - I have all that 
working OK.

I'm now trying to figure out the best way to get access to the database 
from JSPs.  I can either push a DataSource into the ServletContext as an 
attribute and reference that in the JSP (which works) or set up a JNDI 
resource, which I think is a better solution.

What's confusing me is the different DataSource classes that Derby has. 
  The example code I've seen via google uses javax.sql.DataSource in the 
JDNI resource definition, but Derby offers 
ClientConnectionPoolDataSource, ClientDataSource, 
EmbeddedConnectionPoolDataSource and EmbeddedDataSource.  I've read the 
Derby docs that discuss these classes, but they sort of assume you 
already know how it all works!

Do the ConnectionPoolDataSource variants actually provide connection 
pooling, and if so how do I configure a JDNI reference to use them?  How 
do they interact with the Commons DBCP connection pooling that's usually 
used with Tomcat - or do they just replace it?  If the Derby classes 
*do* provide connection pooling, how is it configured?

Basically, help!

Alan Burlison

View raw message