Commit b74d6b33 authored by jshaikh's avatar jshaikh

Changes in Supplier.java for closing connection

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183173 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a56a4c88
......@@ -172,6 +172,13 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
count = rs.getInt(1);
}
//Added by Jaffar on 06-04-18 ---> Start
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//---- End ----
if(count > 0)
{
errCode = "VTSUPNMVLD";
......@@ -243,10 +250,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
count = rs.getInt(1);
}
pstmt.close();
pstmt = null;
//Added by Jaffar on 06-04-18 ---> Start
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//---- End ----
if (count == 0)
{
......@@ -324,6 +333,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
rs = null;
pstmt.close();
pstmt = null;
if(count != 0)
{
// Error : Currency cannot be changed, amt exists in sundrybal.
......@@ -612,10 +622,12 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
count = rs.getInt("count");
}
//Added by Jaffar on 06-04-18 ---> Start
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//---- End ----
if (count == 0)
{
......@@ -1198,16 +1210,21 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
System.out.println("Exception ::"+ e.getMessage());
throw new ITMException(e);
}
//Added by Jaffar on 04 Apr 2018 ---> Start
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
rs = null;
pstmt = null;
}
if(conn != null)
{
conn.close();
......@@ -1220,6 +1237,8 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
d.printStackTrace();
}
}
//------- End -------
return valueXmlString.toString();
}
......@@ -1246,7 +1265,31 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
catch (Exception e) {
// TODO: handle exception
System.out.println("Catch block of Supplier.getfinparm()====> "+e);
}
//Added by Jaffar on 4th Apr 18 ---> Start
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
// ---- End ----
if(addValue == null || addValue.trim().length() == 0)
{
return varValue;
......@@ -1281,6 +1324,13 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
count = rs.getInt(1);
}
//Added by Jaffar on 06-04-18 ---> Start
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//------- End -------
if(count == 0)
{
errCode = "VMCCTR1";
......@@ -1295,6 +1345,13 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
count = rs.getInt(1);
}
//Added by Jaffar on 06-04-18 ---> Start
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// ---- End ----
if(count == 0)
{
sql = "select count(*) from accounts_cctr where acct_code = ? ";
......@@ -1305,6 +1362,13 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
count = rs.getInt(1);
}
//Added by Jaffar on 06-04-18 ---> Start
rs.close();
rs = null;
pstmt.close();
pstmt = null;
//---- End ----
if(count > 0)
{
......@@ -1321,7 +1385,31 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
catch (Exception e) {
// TODO: handle exception
System.out.println("Catch block of Supplier.supplier_cctr()=== "+e);
}
//Added by Jaffar on 4th Apr 18 ---> Start
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
//---- End ----
return errCode;
}
......@@ -1391,15 +1479,16 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
{
count = rs.getInt(1);
}
if(count == 0)
{
errCode = "VMACCT3";
}
//Added by sarita on 16NOV2017
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(count == 0)
{
errCode = "VMACCT3";
}
}
}
......@@ -1411,7 +1500,31 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
}
catch (Exception e) {
// TODO: handle exception
System.out.println("Catch block of Supplier.supplier_acct()=== "+e);
}
//Added by Jaffar on 4th Apr 18 ---> Start
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
//---- End ----
return errCode;
}
public String mid(String fname ,int i , int j)
......@@ -1488,6 +1601,29 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
e.printStackTrace();
throw new ITMException(e);
}
//Added by Jaffar on 4th Apr 18 ---> Start
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
//---- End ----
System.out.println("returning String from findValue " + findValue);
return findValue;
}
......@@ -1533,6 +1669,7 @@ public class Supplier extends ValidatorEJB implements SupplierLocal,SupplierRemo
e.printStackTrace();
}
}
return msgType;
}
}
......
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