Commit 9f45867d authored by ssalve's avatar ssalve

Done changes in finally and method to resolve issues related unclosed...

Done changes in finally and method to resolve issues related unclosed connection/statement on 13NOV2017

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@173476 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 17a0fd4c
......@@ -885,7 +885,12 @@ public class TaxEnvIC extends ValidatorEJB implements TaxEnvICRemote, TaxEnvICLo
if (rs.next()) {
varValue = rs.getString("var_value");
}
//Added by sarita on 13NOV2017
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = " select count(*) as COUNT,ACTIVE from accounts where acct_code=? group by active";
pstmt = conn.prepareStatement(sql);
......@@ -941,6 +946,21 @@ public class TaxEnvIC extends ValidatorEJB implements TaxEnvICRemote, TaxEnvICLo
System.out.println("::" + this.getClass().getSimpleName() + "::::" + e.getMessage());
e.printStackTrace();
}
//Added by sarita on 13NOV2017[start]
finally
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
//Added by sarita on 13NOV2017[end]
return errString;
}
......@@ -962,7 +982,12 @@ public class TaxEnvIC extends ValidatorEJB implements TaxEnvICRemote, TaxEnvICLo
if (rs.next()) {
varValue = rs.getString("var_value");
}
//Added by sarita on 13NOV2017
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (varValue.equalsIgnoreCase("Y")) {
if (!cctrCode.isEmpty()) {
sql = "select count(*) as COUNT from costctr where cctr_code = ?";
......@@ -976,6 +1001,12 @@ public class TaxEnvIC extends ValidatorEJB implements TaxEnvICRemote, TaxEnvICLo
if (rs.next()) {
count = rs.getInt("COUNT");
}
//Added by sarita on 13NOV2017
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (count <= 0) {
errString = "VMCCTR1";
return errString;
......@@ -994,6 +1025,12 @@ public class TaxEnvIC extends ValidatorEJB implements TaxEnvICRemote, TaxEnvICLo
if (rs.next()) {
count = rs.getInt("COUNT");
}
//Added by sarita on 13NOV2017
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("count:::" + count);
if (count <= 0) {
......@@ -1006,6 +1043,21 @@ public class TaxEnvIC extends ValidatorEJB implements TaxEnvICRemote, TaxEnvICLo
+ e.getMessage());
e.printStackTrace();
}
//Added by sarita on 13NOV2017[start]
finally
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
//Added by sarita on 13NOV2017[end]
return errString;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment