diff --git a/base/src/org/compiere/model/MClient.java b/base/src/org/compiere/model/MClient.java index 7387fd1f89..f4919bdb1a 100644 --- a/base/src/org/compiere/model/MClient.java +++ b/base/src/org/compiere/model/MClient.java @@ -66,11 +66,12 @@ public class MClient extends X_AD_Client { ArrayList list = new ArrayList(); String sql = "SELECT * FROM AD_Client"; - PreparedStatement pstmt = null; + PreparedStatement pstmt = null; + ResultSet rs = null; try { pstmt = DB.prepareStatement (sql, null); - ResultSet rs = pstmt.executeQuery (); + rs = pstmt.executeQuery (); while (rs.next ()) { MClient client = new MClient (ctx, rs, null); @@ -85,15 +86,10 @@ public class MClient extends X_AD_Client { s_log.log(Level.SEVERE, sql, e); } - try - { - if (pstmt != null) - pstmt.close (); - pstmt = null; - } - catch (Exception e) - { - pstmt = null; + finally + { + DB.close(rs, pstmt); + rs = null; pstmt = null; } MClient[] retValue = new MClient[list.size ()]; list.toArray (retValue);