tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Johnson" <>
Subject Re: JDBC Statement tag: connection scope
Date Thu, 03 May 2001 16:03:28 GMT

 In the documentation under 'closing connections' it says "unless you're
performing your own connection pooling, always close your connection." Well,
I am performing my own pooling and I would like to set up two connections
(to different DBs) at the beginning of a request, but I can't put them at
REQUEST_SCOPE because the statement tags won't find them.

A side note, the example in the documentation shows 'id' rather than 'conn'
in the sql:closeConnection tag which is incorrect.

----- Original Message -----
From: "Morgan Delagrange" <>
To: <>
Sent: Wednesday, May 02, 2001 1:21 PM
Subject: Re: JDBC Statement tag: connection scope

> On Wed, 2 May 2001, Brent Johnson wrote:
> > The statement tag gets its connection as follows inside of doStartTag():
> > Connection conn = (Connection)pageContext.getAttribute(_connId);
> >
> > This means that the connection must be defined at PAGE_SCOPE.  This
seems a bit restrictive.  What if my connection isn't at page scope?  Is
there a reason why the statement tag doesn't use
> The <sql:connection> tags doesn't support assigning to another scope, so
> that's the only real logic there.  I suppose it could use findAttribute,
> but I don't really dig on people storing Connections at other
> scopes.  That's what database pools are for.  :)
> - Morgan

View raw message