*BF [ 1874419 ] JDBC Statement not close in a finally block

This commit is contained in:
Redhuan D. Oon 2008-02-19 06:29:01 +00:00
parent dcc794fddc
commit 16697248fb
1 changed files with 4 additions and 12 deletions

View File

@ -283,20 +283,18 @@ public class WebUser
+ " AND AD_User_ID=?"; + " AND AD_User_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_AD_Client_ID); pstmt.setInt(1, m_AD_Client_ID);
pstmt.setInt(2, AD_User_ID); pstmt.setInt(2, AD_User_ID);
ResultSet rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
m_bpc = new MUser (m_ctx, rs, null); m_bpc = new MUser (m_ctx, rs, null);
log.fine("= found BPC=" + m_bpc); log.fine("= found BPC=" + m_bpc);
} }
rs.close();
pstmt.close();
pstmt = null;
} }
catch (Exception e) catch (Exception e)
{ {
@ -304,14 +302,8 @@ public class WebUser
} }
finally finally
{ {
try DB.close(rs, pstmt);
{ rs = null; pstmt = null;
if (pstmt != null)
pstmt.close ();
}
catch (Exception e)
{}
pstmt = null;
} }
// Password not entered // Password not entered