commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <dirk.verbe...@pandora.be>
Subject Re: DBCP Getting started
Date Tue, 12 Apr 2005 06:21:26 GMT
JNDI is a naming service, a kind of tree/map between a JNDI name and a 
service object.
Tomcat uses the BasicDataSourceFactory to create a BasicDataSource 
from your configuration settings.
http://jakarta.apache.org/commons/dbcp/xref/org/apache/commons/dbcp/BasicDataSourceFactory.html

There is no functional difference between the DBCP datasource tomcat 
creates or one you would create. Either method works.
Its a matter of preference. If you use JNDI and deploy your 
application on lets say a BEA weblogic platform then you would start 
using their datasource, if you create a BasicDataSource yourself then 
you always know it is the DBCP implementation.

-- Dirk

Scott Purcell wrote:

> I am having trouble understanding how the DBCP classes work within Tomcat.
> 
> I have been on the Tomcat site for the past two days, trying to figure things out. I
have been following their example of how to create a the <Context /> and a <Resource
/> and pull those our using JNDI? in order to use obtain a "DataSource".
> 
> But now after spending some time on the DBCP site, and checking the examples, I do not
see why I need to even use JNDI at all.
> 
> I am looking at a example here: 
> http://cvs.apache.org/viewcvs.cgi/jakarta-commons/dbcp/doc/BasicDataSourceExample.java?view=markup
> 
> And it just shows using the pool without all the JNDI connection, etc.
> 
> 
> Can someone try and explain to me how this fits together, and why Tomcats example of
using DBCP differs from this sites?
> 
> Thanks,
> Scott



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message