tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From QM <qm...@brandxdev.net>
Subject Re: non-servlet helper class to use the tomcat connection pool
Date Sat, 05 Jun 2004 19:22:34 GMT
On Fri, Jun 04, 2004 at 07:07:46PM -0400, jcrowell wrote:
: In other words, how do I access a connection from the connection pool when I
: am not dealing with a JSP or a servlet, and the singleton class is not
: necessarily associated with any particular webapp?

If I understand your question: yes.
As long as a class is run within Tomcat, the pools (and other JNDI
resources) are available to it.

The examples in the docs for accessing a pool, those aren't limited to
servlets or other web-centric code.


You'd do yourself a favor, though, to abstract/centralize your DB access --
or, better yet, your general persistence logic -- into a separate helper
class.  That would make your code more flexible in the long run.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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


Mime
View raw message