*BF [ 1874419 ] JDBC Statement not close in a finally block
This commit is contained in:
parent
78972aabd0
commit
dcc794fddc
|
|
@ -432,33 +432,25 @@ public class WebInfo
|
||||||
+ " AND (C_BPartner_ID=?"
|
+ " AND (C_BPartner_ID=?"
|
||||||
+ " OR SalesRep_ID IN (SELECT AD_User_ID FROM AD_User WHERE C_BPartner_ID=?))";
|
+ " OR SalesRep_ID IN (SELECT AD_User_ID FROM AD_User WHERE C_BPartner_ID=?))";
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
ResultSet rs = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pstmt = DB.prepareStatement(sql, null);
|
pstmt = DB.prepareStatement(sql, null);
|
||||||
pstmt.setInt(1, m_id);
|
pstmt.setInt(1, m_id);
|
||||||
pstmt.setInt(2, getC_BPartner_ID());
|
pstmt.setInt(2, getC_BPartner_ID());
|
||||||
pstmt.setInt(3, getC_BPartner_ID());
|
pstmt.setInt(3, getC_BPartner_ID());
|
||||||
ResultSet rs = pstmt.executeQuery();
|
rs = pstmt.executeQuery();
|
||||||
if (rs.next())
|
if (rs.next())
|
||||||
retValue = new MRequest (m_ctx, rs, null);
|
retValue = new MRequest (m_ctx, rs, null);
|
||||||
rs.close();
|
}
|
||||||
pstmt.close();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "R_Request_ID=" + m_id, e);
|
log.log(Level.SEVERE, "R_Request_ID=" + m_id, e);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
try
|
DB.close(rs, pstmt);
|
||||||
{
|
rs = null; pstmt = null;
|
||||||
if (pstmt != null)
|
|
||||||
pstmt.close ();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{}
|
|
||||||
pstmt = null;
|
|
||||||
}
|
}
|
||||||
log.fine("R_Request_ID=" + m_id + " - " + retValue);
|
log.fine("R_Request_ID=" + m_id + " - " + retValue);
|
||||||
return retValue;
|
return retValue;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue