Small Typo fixes.

Use finally and DB.close() instead of rs.close() and pstmt.close()
This commit is contained in:
trifonnt 2009-07-08 13:56:20 +00:00
parent 5c14fc32ff
commit e03872d7d4
2 changed files with 13 additions and 7 deletions

View File

@ -40,7 +40,7 @@ import org.compiere.util.Ini;
import org.compiere.util.Language; import org.compiere.util.Language;
/** /**
* Print Invoices on Paperor send PDFs * Print Invoices on Paper or send PDFs
* *
* @author Jorg Janke * @author Jorg Janke
* @version $Id: InvoicePrint.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ * @version $Id: InvoicePrint.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $
@ -218,12 +218,16 @@ public class InvoicePrint extends SvrProcess
int C_BPartner_ID = 0; int C_BPartner_ID = 0;
int count = 0; int count = 0;
int errors = 0; int errors = 0;
PreparedStatement pstmt = null;
ResultSet rs = null;
try try
{ {
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); pstmt = DB.prepareStatement(sql.toString(), get_TrxName());
pstmt.setInt(1, Env.getAD_Client_ID(Env.getCtx())); pstmt.setInt(1, Env.getAD_Client_ID(Env.getCtx()));
pstmt.setInt(2, Env.getAD_Org_ID(Env.getCtx())); pstmt.setInt(2, Env.getAD_Org_ID(Env.getCtx()));
ResultSet rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {
int C_Invoice_ID = rs.getInt(1); int C_Invoice_ID = rs.getInt(1);
@ -344,15 +348,16 @@ public class InvoicePrint extends SvrProcess
.append (C_Invoice_ID); .append (C_Invoice_ID);
int no = DB.executeUpdate(sb.toString(), get_TrxName()); int no = DB.executeUpdate(sb.toString(), get_TrxName());
} }
} // for all entries } // for all entries
rs.close();
pstmt.close();
} }
catch (Exception e) catch (Exception e)
{ {
log.log(Level.SEVERE, "doIt - " + sql, e); log.log(Level.SEVERE, "doIt - " + sql, e);
throw new Exception (e); throw new Exception (e);
} }
finally {
DB.close(rs, pstmt);
}
// //
if (p_EMailPDF) if (p_EMailPDF)
return "@Sent@=" + count + " - @Errors@=" + errors; return "@Sent@=" + count + " - @Errors@=" + errors;

View File

@ -51,6 +51,7 @@ public class ProjectIssue extends SvrProcess
/** Product - Option 4 */ /** Product - Option 4 */
private int m_M_Product_ID = 0; private int m_M_Product_ID = 0;
/** Attribute - Option 4 */ /** Attribute - Option 4 */
@SuppressWarnings("unused")
private int m_M_AttributeSetInstance_ID = 0; private int m_M_AttributeSetInstance_ID = 0;
/** Qty - Option 4 */ /** Qty - Option 4 */
private BigDecimal m_MovementQty = null; private BigDecimal m_MovementQty = null;
@ -345,7 +346,7 @@ public class ProjectIssue extends SvrProcess
} // projectIssueHasExpense } // projectIssueHasExpense
/** /**
* Check if Project Isssye already has Receipt * Check if Project Issue already has Receipt
* @param M_InOutLine_ID line * @param M_InOutLine_ID line
* @return true if exists * @return true if exists
*/ */