left out one db.close

This commit is contained in:
Redhuan D. Oon 2008-02-08 19:21:31 +00:00
parent b46a2dd4ed
commit 70159b94bf
1 changed files with 6 additions and 13 deletions

View File

@ -121,30 +121,23 @@ public class MAlert extends X_AD_Alert
+ "WHERE AD_Alert_ID=?"; + "WHERE AD_Alert_ID=?";
ArrayList<MAlertRecipient> list = new ArrayList<MAlertRecipient>(); ArrayList<MAlertRecipient> list = new ArrayList<MAlertRecipient>();
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null;
try try
{ {
pstmt = DB.prepareStatement (sql, null); pstmt = DB.prepareStatement (sql, null);
pstmt.setInt (1, getAD_Alert_ID()); pstmt.setInt (1, getAD_Alert_ID());
ResultSet rs = pstmt.executeQuery (); rs = pstmt.executeQuery ();
while (rs.next ()) while (rs.next ())
list.add (new MAlertRecipient (getCtx(), rs, null)); list.add (new MAlertRecipient (getCtx(), rs, null));
rs.close (); }
pstmt.close ();
pstmt = null;
}
catch (Exception e) catch (Exception e)
{ {
log.log(Level.SEVERE, sql, e); log.log(Level.SEVERE, sql, e);
} }
try finally
{ {
if (pstmt != null) DB.close(rs, pstmt);
pstmt.close (); rs = null; pstmt = null;
pstmt = null;
}
catch (Exception e)
{
pstmt = null;
} }
// //
m_recipients = new MAlertRecipient[list.size ()]; m_recipients = new MAlertRecipient[list.size ()];