Bugs-1874419 ] JDBC Statement not close in a finally block
Trying out another case for review. Tested call of the method - ok.
This commit is contained in:
parent
5d2f5de9c2
commit
070b7a20ea
|
@ -1008,11 +1008,12 @@ public final class AEnv
|
|||
|
||||
log.config(sqlRolePermission);
|
||||
PreparedStatement prolestmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
prolestmt = DB.prepareStatement (sqlRolePermission, null);
|
||||
|
||||
ResultSet rs = prolestmt.executeQuery ();
|
||||
rs = prolestmt.executeQuery ();
|
||||
|
||||
rs.next();
|
||||
|
||||
|
@ -1024,29 +1025,17 @@ public final class AEnv
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
rs.close ();
|
||||
prolestmt.close ();
|
||||
prolestmt = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
{
|
||||
System.out.println(e);
|
||||
log.log(Level.SEVERE, "(1)", e);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (prolestmt != null)
|
||||
{
|
||||
prolestmt.close ();
|
||||
}
|
||||
prolestmt = null;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
prolestmt = null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, prolestmt);
|
||||
rs = null; prolestmt = null;
|
||||
}
|
||||
|
||||
return result;
|
||||
} // canAccessInfo
|
||||
|
|
Loading…
Reference in New Issue