commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kelly <>
Subject Re: DBCP - not closing connections?
Date Tue, 08 Nov 2005 09:23:48 GMT
Hi David,

You are right about dong it the hard way! Unfortunately I don't have 
access to the Tomcat setup on the server, because my application is a 
plugin inside another web app, which is running on a hosted service.

I will push for access to add a datasource as in your example, but in 
the meantime I have no option but to do things this way.

The other points are well taken. This application was written when I was 
a (complete) beginner and will be refactored if time allows.



David Graham wrote:
> MIke,
> You are really doing this the hard way.  Since you are using JSP that
> means you're app is running in a web container.  All containers support
> configuring a DataSource in JNDI and looking it up from there.  Tomcat is
> especially easy to setup.
> Here are the instructions for Tomcat 5.5 (other versions are similar but
> different):
> Once you're using a DataSource from the container's JNDI directory you can
> cleanup the JDBC code.  Querying the database from a JSP is bad form.  The
> JSP should *only* be handling the display logic, not the query logic. 
> Queries generally belong in a Java bean.
> However, if you still want to query the database from your JSP, please use
> the standard sql tags in the JSTL.  The Tomcat link above has an example
> usage.  Also, here's a couple links to get you started.
> Sun's JSTL Homepage:
> Apache Taglib implementation of JSTL:
> David
> --- Mike Kelly <> wrote:


Mike Kelly
Multimedia Developer
IT Research and Development Unit
University of the Arts London
020 7514 6206

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message