tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Lucia" <timlu...@yahoo.com>
Subject RE: tomcat + postgres
Date Thu, 02 Feb 2006 00:00:56 GMT
Without knowing what book you refer to, and what class or interface
ConnectionPoolDataSource represents, it is difficult to know for sure.  

DataSource (javax.sql.DataSource) is an Interface, not a class.  Objects
returned from tomcat are sure to implement this interface, and are pooled
behind the scene, i.e., you do not care what the implementation class is.
So, I would recommend going with javax.sql.DataSource.

I.e., in context.xml, you say:

<Resource name="my/datasource/name" type="javax.sql.DataSource" 
...
</Resource>

And in your code, you expect the returned object to be a
javax.sql.DataSource (from the initial context, lookup, etc.)

Tim

-----Original Message-----
From: Matthew Whisenhunt [mailto:matt@quickset-it.com] 
Sent: Wednesday, February 01, 2006 4:06 PM
To: users@tomcat.apache.org
Subject: tomcat + postgres


I followed the howto about connection pooling at 
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

and I had following question:

Do I use the DataSource class like in the example or the 
ConnectionPoolDataSource class (like it says to do in my book)?

Any insights would be very appreciated.
-Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message