MInventory:

* db fix
This commit is contained in:
teo_sarca 2008-05-30 16:07:12 +00:00
parent d57133a358
commit bd540ac2aa
1 changed files with 7 additions and 12 deletions

View File

@ -121,28 +121,23 @@ public class MInventory extends X_M_Inventory implements DocAction
ArrayList<MInventoryLine> list = new ArrayList<MInventoryLine>(); ArrayList<MInventoryLine> list = new ArrayList<MInventoryLine>();
String sql = "SELECT * FROM M_InventoryLine WHERE M_Inventory_ID=? ORDER BY Line"; String sql = "SELECT * FROM M_InventoryLine WHERE M_Inventory_ID=? ORDER BY Line";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null;
try try
{ {
pstmt = DB.prepareStatement (sql, get_TrxName()); pstmt = DB.prepareStatement (sql, get_TrxName());
pstmt.setInt (1, getM_Inventory_ID()); pstmt.setInt (1, getM_Inventory_ID());
ResultSet rs = pstmt.executeQuery (); rs = pstmt.executeQuery ();
while (rs.next ()) while (rs.next ())
list.add (new MInventoryLine (getCtx(), rs, get_TrxName())); list.add (new MInventoryLine (getCtx(), rs, get_TrxName()));
rs.close (); }
pstmt.close (); catch (Exception e)
pstmt = null;
} 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_lines = new MInventoryLine[list.size ()]; m_lines = new MInventoryLine[list.size ()];