BF [ 1874419 ] JDBC Statement not close in a finally block
This commit is contained in:
parent
9e328e0500
commit
1cfcf92f6a
|
@ -220,21 +220,25 @@ public class MWindow extends X_AD_Window
|
|||
public static int getWindow_ID(String windowName) {
|
||||
int retValue = 0;
|
||||
String SQL = "SELECT AD_Window_ID FROM AD_Window WHERE Name = ?";
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
PreparedStatement pstmt = DB.prepareStatement(SQL, null);
|
||||
pstmt = DB.prepareStatement(SQL, null);
|
||||
pstmt.setString(1, windowName);
|
||||
ResultSet rs = pstmt.executeQuery();
|
||||
rs = pstmt.executeQuery();
|
||||
if (rs.next())
|
||||
retValue = rs.getInt(1);
|
||||
rs.close();
|
||||
pstmt.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
s_log.log(Level.SEVERE, SQL, e);
|
||||
retValue = -1;
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
}
|
||||
return retValue;
|
||||
}
|
||||
//end vpj-cd e-evolution
|
||||
|
|
Loading…
Reference in New Issue