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