commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: [dbutils] use it for Tomcat DB connection pooling
Date Fri, 24 Feb 2006 16:00:31 GMT
DBUtils works fine with Tomcat.  It works with any DataSource
implementation.  Just create a QueryRunner with a DataSource reference
like this:
QueryRunner run = new QueryRunner(myDataSource);

QueryRunner will take care of properly closing your ResultSets,
PreparedStatements and Connections for you.  This relieves much of the
drudgery of Java database queries.

David


--- TomṠProch�zka <t.prochazka@centrum.cz> wrote:

> Hi.
> 
> I have one question.
> 
> Is possible use DBUtils in Tomcat container where connection is from
> pooling?
> 
> On the page
>
http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html
> is  properly written code to use a db connection obtained from a
> connection pool. 
> 
> This example close RS,Statement and Connection immediately after use it
> and again in finnaly block. Also set reference pointer to null. Its
> problem, that DBUtils doesn't make this?
> 
> Exist any another small and usefull library especially for Tomcat?
> 
> Thanks you for reply.
> 
> -- 
> Tomas Prochazka
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


Get Firefox!
http://www.mozilla.com/firefox/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
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