Or use finally, which practically guarantees closure no matter what

On 9/4/02 2:31 pm, "Tim Endres" <[EMAIL PROTECTED]> wrote:

>>       try
>>       {
>>         if(rs != null)
>>           rs.close();
>>         if(ps != null)
>>           ps.close();
>>         if(conn != null)
>>           conn.close();
>>       }
>>       catch(SQLException sqle)
>>       {
>>         sqle.printStackTrace();
>>       }
> 
> You do not make it clear, but if either rs.close() or ps.close()
> has an exception, then conn.close() will never be called. Could
> that be your issue?
> 
> In a finally, I usually try/catch each of those closes individually
> to avoid just such a problem.
> 
> tim.
> 
> 


Reply via email to