From fc9dd192a8eacda0828b5ddc866c6ad17c704c1b Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Fri, 30 May 2008 16:10:37 +0000 Subject: [PATCH] MInventoryLineMA: db fix --- .../org/compiere/model/MInventoryLineMA.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/base/src/org/compiere/model/MInventoryLineMA.java b/base/src/org/compiere/model/MInventoryLineMA.java index f1d99218df..a700e1b357 100644 --- a/base/src/org/compiere/model/MInventoryLineMA.java +++ b/base/src/org/compiere/model/MInventoryLineMA.java @@ -43,30 +43,23 @@ public class MInventoryLineMA extends X_M_InventoryLineMA ArrayList list = new ArrayList(); String sql = "SELECT * FROM M_InventoryLineMA WHERE M_InventoryLine_ID=?"; PreparedStatement pstmt = null; + ResultSet rs = null; try { pstmt = DB.prepareStatement (sql, trxName); pstmt.setInt (1, M_InventoryLine_ID); - ResultSet rs = pstmt.executeQuery (); + rs = pstmt.executeQuery (); while (rs.next ()) list.add (new MInventoryLineMA (ctx, rs, trxName)); - rs.close (); - pstmt.close (); - pstmt = null; } catch (Exception e) { s_log.log (Level.SEVERE, sql, e); } - try + finally { - if (pstmt != null) - pstmt.close (); - pstmt = null; - } - catch (Exception e) - { - pstmt = null; + DB.close(rs, pstmt); + rs = null; pstmt = null; } MInventoryLineMA[] retValue = new MInventoryLineMA[list.size ()];