Hi all,

Closing all ResultSets, Statements, Connection in the finally block fixed my app that 
stops crashing.

Thanks everybody...
Marcelo



On Wed, 07 Apr 2004 09:00:16 -0400, "Dean A. Hoover" <[EMAIL PROTECTED]> escreveu:

> De: "Dean A. Hoover" <[EMAIL PROTECTED]>
> Data: Wed, 07 Apr 2004 09:00:16 -0400
> Para: Struts Users Mailing List <[EMAIL PROTECTED]>
> Assunto: Re: Connection Pooling (How i use...)
> 
> So, are there implied catches in there for SQLException (I assume there 
> are)?
> In the innermost try block, does the catch rethrow the SQLException so that
> it cascades to the outer blocks?
> 
> Just trying to understand the model.
> 
> Dean Hoover
> 
> Larry Meadors wrote:
> 
> >Yes. 
> >
> >You really might want to consider a tool like iBATIS, but if you want to
> >do it yourself, here is the pattern:
> >
> >Connection c = null;
> >try{
> >  //get connection
> >  try{
> >    // get statement
> >    try{
> >      // get result set
> >      // process result set
> >    }finally{
> >      // close result set if not null
> >    }
> >  }finally{
> >    // close statement if not null
> >  }
> >}finally{
> >  //close connection if not null
> >}
> >
> >Larry
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >  
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to