Commit 25157dfa authored by arawankar's avatar arawankar

-Connection closing related changes made in below components

MiscVoucherAct.java
VouchPayAct.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@189965 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9e1a6b2e
...@@ -82,6 +82,25 @@ public class MiscVoucherAct extends ActionHandlerEJB implements MiscVoucherActLo ...@@ -82,6 +82,25 @@ public class MiscVoucherAct extends ActionHandlerEJB implements MiscVoucherActLo
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
//Modified by Anjali R. on [28/08/2018][connection was not close][start]
finally
{
try
{
if(conn != null)
{
conn.close();
conn = null;
}
}
catch(Exception ex)
{
System.out.println("Exception in actionHandler--["+ ex.getMessage() +"]");
ex.printStackTrace();
}
}
//Modified by Anjali R. on [28/08/2018][connection was not close][End]
System.out.println("returning from actionVoucher actionHandler"+resString); System.out.println("returning from actionVoucher actionHandler"+resString);
return resString; return resString;
...@@ -105,9 +124,9 @@ public class MiscVoucherAct extends ActionHandlerEJB implements MiscVoucherActLo ...@@ -105,9 +124,9 @@ public class MiscVoucherAct extends ActionHandlerEJB implements MiscVoucherActLo
if (detCnt.equals("0")) if (detCnt.equals("0"))
{ {
//Changes and Commented By Bhushan on 06-06-2016 :START //Changes and Commented By Bhushan on 06-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM"); //conn = connDriver.getConnectDB("DriverITM");
conn = getConnection(); conn = getConnection();
//Changes and Commented By Bhushan on 06-06-2016 :END //Changes and Commented By Bhushan on 06-06-2016 :END
stmt = conn.createStatement(); stmt = conn.createStatement();
sundryType = genericUtility.getColumnValue("sundry_type",dom); sundryType = genericUtility.getColumnValue("sundry_type",dom);
......
...@@ -52,6 +52,24 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -52,6 +52,24 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
//Modified by Anjali R. on [28/08/2018][connection was not close][start]
finally
{
try
{
if(conn != null)
{
conn.close();
conn = null;
}
}
catch(Exception ex)
{
System.out.println("Exception in actionHandler--["+ ex.getMessage() +"]");
ex.printStackTrace();
}
}
//Modified by Anjali R. on [28/08/2018][connection was not close][End]
System.out.println("returning from actionVoucher actionHandler"+resString); System.out.println("returning from actionVoucher actionHandler"+resString);
return resString; return resString;
...@@ -108,10 +126,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -108,10 +126,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
autoPay=rs.getString(3); autoPay=rs.getString(3);
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null; pstmt=null;
rs.close(); rs.close();
rs=null; rs=null;*/
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
sql="select count(1) from misc_paydet where tran_ser= ? and vouch_no= ?"; sql="select count(1) from misc_paydet where tran_ser= ? and vouch_no= ?";
...@@ -124,11 +154,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -124,11 +154,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
refCount=rs.getInt(1); refCount=rs.getInt(1);
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null; pstmt=null;
rs.close(); rs.close();
rs=null; rs=null;*/
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
System.out.println("conf["+conf+"] paymode["+payMode+"] refNo ["+refNo+"] refCount["+refCount+"]"); System.out.println("conf["+conf+"] paymode["+payMode+"] refNo ["+refNo+"] refCount["+refCount+"]");
//validation if not confirmed //validation if not confirmed
...@@ -212,11 +253,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -212,11 +253,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
tranSerM=rs.getString("tran_ser"); tranSerM=rs.getString("tran_ser");
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null; pstmt=null;
rs.close(); rs.close();
rs=null; rs=null;*/
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
Timestamp today = new java.sql.Timestamp(System.currentTimeMillis()); Timestamp today = new java.sql.Timestamp(System.currentTimeMillis());
...@@ -248,8 +300,21 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -248,8 +300,21 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
cctrCodeCfAp = cctrCodeCf; cctrCodeCfAp = cctrCodeCf;
} }
pstmt.close();
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
//calculating discount for Voucher //calculating discount for Voucher
if("VOUCH".equalsIgnoreCase(tranSer)) if("VOUCH".equalsIgnoreCase(tranSer))
...@@ -263,8 +328,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -263,8 +328,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
purcOrder=rs.getString("purc_order"); purcOrder=rs.getString("purc_order");
effDate=rs.getTimestamp("eff_date"); effDate=rs.getTimestamp("eff_date");
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
sql="select cr_term from porder where purc_order = ?"; sql="select cr_term from porder where purc_order = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -274,8 +351,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -274,8 +351,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
pCrTerm=rs.getString("cr_term"); pCrTerm=rs.getString("cr_term");
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
sql="select crtermfc.fin_chg,crterm.acct_code__disc,crterm.cctr_code__disc,crterm.start_from " sql="select crtermfc.fin_chg,crterm.acct_code__disc,crterm.cctr_code__disc,crterm.start_from "
...@@ -291,8 +380,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -291,8 +380,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
cctrCodeDisc=rs.getString("cctr_code__disc"); cctrCodeDisc=rs.getString("cctr_code__disc");
startFrom=rs.getString("start_from"); startFrom=rs.getString("start_from");
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
ldDiscountDt = calcDiscountDate(pCrTerm,(sdf.format(refDate)),(sdf.format(effDate)),(sdf.format(billDate)),conn); ldDiscountDt = calcDiscountDate(pCrTerm,(sdf.format(refDate)),(sdf.format(effDate)),(sdf.format(billDate)),conn);
System.out.println("Test"+ldDiscountDt); System.out.println("Test"+ldDiscountDt);
...@@ -308,8 +409,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -308,8 +409,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
lcDiscount=rs.getDouble(1); lcDiscount=rs.getDouble(1);
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
if(startFrom!=null && startFrom.trim().length()>0 ) if(startFrom!=null && startFrom.trim().length()>0 )
{ {
...@@ -401,8 +514,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -401,8 +514,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
chq1Str=rs.getString("chq1"); chq1Str=rs.getString("chq1");
chq2Str=rs.getString("chq2"); chq2Str=rs.getString("chq2");
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
if ( (chq1Str!= null && chq1Str.trim().length()>0) &&(chq2Str!= null && chq2Str.trim().length()>0) ) if ( (chq1Str!= null && chq1Str.trim().length()>0) &&(chq2Str!= null && chq2Str.trim().length()>0) )
{ {
...@@ -421,8 +546,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -421,8 +546,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
llRefNo=rs.getLong(1); llRefNo=rs.getLong(1);
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
if (llRefNo==0) if (llRefNo==0)
{ {
...@@ -543,6 +680,13 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -543,6 +680,13 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
try try
{ {
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
if(rs != null)
{
rs.close();
rs = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
if(pstmt1 != null) if(pstmt1 != null)
{ {
pstmt1.close(); pstmt1.close();
...@@ -643,7 +787,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -643,7 +787,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
throw new ITMException(e); throw new ITMException(e);
} }
return retString; return retString;
} }
private Timestamp calcDiscountDate(String crTerm, String vouchDate, String effDate, String billDate,Connection conn) throws ITMException private Timestamp calcDiscountDate(String crTerm, String vouchDate, String effDate, String billDate,Connection conn) throws ITMException
{ {
String discountDate="",sql="",lsStart="",lsMonth="",lsOverridediscdt=""; String discountDate="",sql="",lsStart="",lsMonth="",lsOverridediscdt="";
...@@ -717,10 +861,23 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -717,10 +861,23 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
sqlCount++; sqlCount++;
lsOverridediscdt=checkNull(rs.getString("override_discount_date")); lsOverridediscdt=checkNull(rs.getString("override_discount_date"));
} }
pstmt.close();
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null; pstmt=null;
rs.close(); rs.close();
rs=null; rs=null;*/
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
//System.out.println("@@@@@@@@1613 lsOverridediscdt["+lsOverridediscdt+"]");// //System.out.println("@@@@@@@@1613 lsOverridediscdt["+lsOverridediscdt+"]");//
if(sqlCount>0) if(sqlCount>0)
{ {
...@@ -745,10 +902,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -745,10 +902,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
lsOverridediscdt=checkNull(rs.getString("override_discount_date")); lsOverridediscdt=checkNull(rs.getString("override_discount_date"));
liDays=rs.getInt("max_day"); liDays=rs.getInt("max_day");
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null; pstmt=null;
rs.close(); rs.close();
rs=null; rs=null;*/
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
//System.out.println("@@@@@@@@1614 lsOverridediscdt["+lsOverridediscdt+"]"); //System.out.println("@@@@@@@@1614 lsOverridediscdt["+lsOverridediscdt+"]");
if(sqlCount>0) if(sqlCount>0)
{ {
...@@ -765,10 +934,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -765,10 +934,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
sqlCount++; sqlCount++;
liDays=rs.getInt("max_day"); liDays=rs.getInt("max_day");
} }
pstmt.close(); //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null; pstmt=null;
rs.close(); rs.close();
rs=null; rs=null;*/
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
if(sqlCount>0) if(sqlCount>0)
{ {
...@@ -851,10 +1032,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -851,10 +1032,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
stanCode = checkNull(rs.getString("stan_code")); stanCode = checkNull(rs.getString("stan_code"));
} }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
rs.close();
rs=null;*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs = null; }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
System.out.println("StanCode from Sundry type=E>>>>>>" + stanCode); System.out.println("StanCode from Sundry type=E>>>>>>" + stanCode);
} }
else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("S".equalsIgnoreCase(sundryType))) else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("S".equalsIgnoreCase(sundryType)))
...@@ -867,10 +1060,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -867,10 +1060,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
stanCode = checkNull(rs.getString("stan_code")); stanCode = checkNull(rs.getString("stan_code"));
} }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
rs.close(); rs.close();
rs=null;*/
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs = null; }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
System.out.println("StanCode from Sundry type= S>>>>>>" + stanCode); System.out.println("StanCode from Sundry type= S>>>>>>" + stanCode);
} }
else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("C".equalsIgnoreCase(sundryType))) else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("C".equalsIgnoreCase(sundryType)))
...@@ -883,10 +1088,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -883,10 +1088,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
stanCode = checkNull(rs.getString("stan_code")); stanCode = checkNull(rs.getString("stan_code"));
} }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
rs.close();
rs=null;*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs = null; }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
System.out.println("StanCode from Sundry type=C>>>>>>" + stanCode); System.out.println("StanCode from Sundry type=C>>>>>>" + stanCode);
} }
else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("P".equalsIgnoreCase(sundryType))) else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("P".equalsIgnoreCase(sundryType)))
...@@ -899,10 +1116,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -899,10 +1116,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
empCode = checkNull(rs.getString("emp_code")); empCode = checkNull(rs.getString("emp_code"));
} }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
rs.close(); rs.close();
rs=null;*/
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs = null; }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
System.out.println("empCode from Sundry type=P>>>>>>" + empCode); System.out.println("empCode from Sundry type=P>>>>>>" + empCode);
...@@ -916,10 +1145,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -916,10 +1145,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
stanCode = checkNull(rs.getString("stan_code")); stanCode = checkNull(rs.getString("stan_code"));
} }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
rs.close();
rs=null;*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs = null; }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
System.out.println("StanCode from Sundry type=P>>>>>>" + stanCode); System.out.println("StanCode from Sundry type=P>>>>>>" + stanCode);
} }
...@@ -934,10 +1175,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -934,10 +1175,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
stanCode = checkNull(rs.getString("stan_code")); stanCode = checkNull(rs.getString("stan_code"));
} }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
rs.close(); rs.close();
rs=null;*/
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs = null; }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
System.out.println("StanCode from Sundry type= T>>>>>>" + stanCode); System.out.println("StanCode from Sundry type= T>>>>>>" + stanCode);
} }
else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("X".equalsIgnoreCase(sundryType))) else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("X".equalsIgnoreCase(sundryType)))
...@@ -950,10 +1203,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -950,10 +1203,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
stanCode = checkNull(rs.getString("stan_code")); stanCode = checkNull(rs.getString("stan_code"));
} }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
rs.close();
rs=null;*/
if(rs != null)
{
rs.close(); rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs = null; }
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
System.out.println("StanCode from Sundry type= X>>>>>>" + stanCode); System.out.println("StanCode from Sundry type= X>>>>>>" + stanCode);
} }
...@@ -968,14 +1233,27 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V ...@@ -968,14 +1233,27 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{ {
try try
{ {
if(pstmt!=null) //Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
/*if(pstmt!=null)
{ {
pstmt.close();pstmt=null; pstmt.close();pstmt=null;
} }
if(rs!=null) if(rs!=null)
{ {
rs.close();rs=null; rs.close();rs=null;
} }*/
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
} }
catch(Exception ex) catch(Exception ex)
{ {
......
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