*BF [ 1874419 ] JDBC Statement not close in a finally block
This commit is contained in:
parent
dcc794fddc
commit
16697248fb
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue