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
......@@ -38,7 +38,7 @@ public class MiscVoucherAct extends ActionHandlerEJB implements MiscVoucherActLo
{
return "";
}
public String actionHandler(String actionType, String xmlString, String objContext, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
......@@ -56,14 +56,14 @@ public class MiscVoucherAct extends ActionHandlerEJB implements MiscVoucherActLo
resString = actionDefault(dom,objContext,xtraParams);
}
}
catch(Exception e)
catch(Exception e)
{
System.out.println("Exception :MiscVoucher :actionHandler(String xmlString):" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("returning from actionVoucher actionHandler"+resString);
return resString;
return resString;
}
public String actionHandler(String tranId, String xtraParams, String forcedFlag) throws RemoteException, ITMException
{
......@@ -74,19 +74,38 @@ public class MiscVoucherAct extends ActionHandlerEJB implements MiscVoucherActLo
conn=getConnection();
VouchPayAct vouchpay=new VouchPayAct();
resString=vouchpay.actionPay(tranId, xtraParams, "M-VOUC",false,conn);
}
catch(Exception e)
catch(Exception e)
{
System.out.println("Exception :MiscVoucher :actionHandler(String xmlString):" + e.getMessage() + ":");
e.printStackTrace();
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);
return resString;
return resString;
}
private String actionDefault(Document dom, String objContext, String xtraParams) throws RemoteException , ITMException
{
String sundryType = "", sql = "", detCnt = "0", empCode = "", sundryCode = "", cctrCode = "", acctCode ="", grade = "", billNo = "", billDate = "";
......@@ -105,9 +124,9 @@ public class MiscVoucherAct extends ActionHandlerEJB implements MiscVoucherActLo
if (detCnt.equals("0"))
{
//Changes and Commented By Bhushan on 06-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 06-06-2016 :END
//conn = connDriver.getConnectDB("DriverITM");
conn = getConnection();
//Changes and Commented By Bhushan on 06-06-2016 :END
stmt = conn.createStatement();
sundryType = genericUtility.getColumnValue("sundry_type",dom);
......@@ -228,7 +247,7 @@ conn = getConnection();
int metaDataNodeListLen = metaDataList.getLength();
int importedListLen = importedList.getLength();
System.out.println("\n metaDataNodeListLen :"+metaDataNodeListLen+"\n importedListLen :"+importedListLen);
//Added by jiten
boolean flag = false;
NodeList childNodeList = null;
......
......@@ -31,7 +31,7 @@ import org.w3c.dom.Document;
@Stateless
public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, VouchPayActRemote
{
String userId = "", termId = "";
E12GenericUtility genericUtility = new E12GenericUtility();
......@@ -44,17 +44,35 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
conn = getConnection();
resString = actionPay(tranId,xtraParams,"VOUCH",false,conn);
}
catch(Exception e)
catch(Exception e)
{
System.out.println("Exception :MiscVoucher :actionHandler(String xmlString):" + e.getMessage() + ":");
e.printStackTrace();
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);
return resString;
return resString;
}
public String actionPay(String tranId,String xtraParams, String tranSer,boolean onConf,Connection conn) throws RemoteException , ITMException
{
......@@ -67,36 +85,36 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
int refCount=0;
String sql="";
ITMDBAccessEJB itmDBAccessEJB=new ITMDBAccessEJB();
String tranType = "",loginUser = "",tranID = "",insertSql = "",remarks = "",lsRefNo="",chq2Str="",chq1Str="";
String termID = "",currCodeBc = "",exchRateBc = "",filtBankCodeAdd = "",filtBankCodeAddName = "";
String acctCodeBal = "",cctrCodeBal = "",acctCodeBc = "",cctrCodeBc = "",acctCodeCf = "";
String acctCodeCfAp = "",cctrCodeCfAp = "",cctrCodeCf = "",updateSql = "",exchRateHdr = "";
SimpleDateFormat sdf = null;
//ConnDriver connDriver = new ConnDriver();
FinCommon finCommon = new FinCommon();
Timestamp tranDate=null,billDate=null,dueDate=null,refDate=null,effDate=null,ldDiscountDt=null,ldStartDate=null;
String billNo="",currCode="",acctCode="",cctrCode="",siteCode="",finEntity="",sundryType="",bankCode="",userName="",sundryCode="",tranSerM="",
purcOrder="",pCrTerm="",acctCodeDisc="",cctrCodeDisc="",startFrom="";
double exchRate=0.0d,totAmt=0.0d,advAmt=0.0d,holdAmt=0.0d,netPayable=0.0d,adjAmt=0.0d,lcDiscount=0.0d,lcDiscountAmt=0.0d,payAmt=0.0d,totAmount=0.0d;
double chq1=0,chq2=0;
long llRefNo=0;
E12GenericUtility genericUtility = new E12GenericUtility();
try
String tranType = "",loginUser = "",tranID = "",insertSql = "",remarks = "",lsRefNo="",chq2Str="",chq1Str="";
String termID = "",currCodeBc = "",exchRateBc = "",filtBankCodeAdd = "",filtBankCodeAddName = "";
String acctCodeBal = "",cctrCodeBal = "",acctCodeBc = "",cctrCodeBc = "",acctCodeCf = "";
String acctCodeCfAp = "",cctrCodeCfAp = "",cctrCodeCf = "",updateSql = "",exchRateHdr = "";
SimpleDateFormat sdf = null;
//ConnDriver connDriver = new ConnDriver();
FinCommon finCommon = new FinCommon();
Timestamp tranDate=null,billDate=null,dueDate=null,refDate=null,effDate=null,ldDiscountDt=null,ldStartDate=null;
String billNo="",currCode="",acctCode="",cctrCode="",siteCode="",finEntity="",sundryType="",bankCode="",userName="",sundryCode="",tranSerM="",
purcOrder="",pCrTerm="",acctCodeDisc="",cctrCodeDisc="",startFrom="";
double exchRate=0.0d,totAmt=0.0d,advAmt=0.0d,holdAmt=0.0d,netPayable=0.0d,adjAmt=0.0d,lcDiscount=0.0d,lcDiscountAmt=0.0d,payAmt=0.0d,totAmount=0.0d;
double chq1=0,chq2=0;
long llRefNo=0;
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
System.out.println("TranID["+tranId+"]");
String userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
System.out.println("userId"+userId+"]");
if("M-VOUC".equalsIgnoreCase(tranSer))
{
sql="Select confirmed,pay_mode,auto_pay from misc_voucher where tran_id= ?";
sql="Select confirmed,pay_mode,auto_pay from misc_voucher where tran_id= ?";
}
else
{
sql="Select confirmed,pay_mode,auto_pay from voucher where tran_id= ?";
sql="Select confirmed,pay_mode,auto_pay from voucher where tran_id= ?";
}
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranId);
......@@ -106,14 +124,26 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
conf=rs.getString(1);
payMode=rs.getString(2);
autoPay=rs.getString(3);
}
pstmt.close();
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
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= ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, tranSer);
......@@ -122,15 +152,26 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
if(rs.next())
{
refCount=rs.getInt(1);
}
pstmt.close();
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
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+"]");
//validation if not confirmed
if(!"Y".equalsIgnoreCase(conf))
{
......@@ -151,36 +192,36 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
errCode="VTINMODE";
errString = itmDBAccessEJB.getErrorString("",errCode, "", "", conn);
return errString;
}
loginUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
termID = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
tranType = finCommon.getFinparams("999999","TRAN_TYPE_AUTO_PAY",conn);
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
if("NULLFOUND".equalsIgnoreCase(tranType))
tranType = "O";
//getting data from misc_payables
sql="SELECT MISC_PAYABLES.REF_NO,MISC_PAYABLES.TRAN_DATE,MISC_PAYABLES.REF_DATE,MISC_PAYABLES.BILL_NO,"
+ "MISC_PAYABLES.BILL_DATE,MISC_PAYABLES.CURR_CODE,MISC_PAYABLES.EXCH_RATE,MISC_PAYABLES.SUNDRY_CODE,"
+ "MISC_PAYABLES.ACCT_CODE,MISC_PAYABLES.CCTR_CODE,MISC_PAYABLES.DUE_DATE,MISC_PAYABLES.SITE_CODE,"
+ "MISC_PAYABLES.FIN_ENTITY,MISC_PAYABLES.TOT_AMT,MISC_PAYABLES.SUNDRY_TYPE,MISC_PAYABLES.BANK_CODE,"
+ "CASE WHEN MISC_PAYABLES.PAY_MODE IS NULL THEN '' ELSE MISC_PAYABLES.PAY_MODE END as PAY_MODE,MISC_PAYABLES.ADV_AMT,MISC_PAYABLES.TRAN_ID,MISC_PAYABLES.TRAN_SER,MISC_PAYABLES.ADJ_AMT,"
+ "MISC_PAYABLES.HOLD_AMT, fn_confirmed_by(misc_payables.tran_ser, misc_payables.ref_no) as username,"
+ "misc_payables.tot_amt - (case when misc_payables.adj_amt is null then 0 else misc_payables.adj_amt end) - (case when misc_payables.hold_amt is null then 0 else misc_payables.hold_amt end) as net_payable "
+ "FROM MISC_PAYABLES WHERE "
//+ "( misc_payables.sundry_type like '' ) AND"
//+ "( misc_payables.sundry_code like '' ) AND"
+ "( misc_payables.ref_no = ? ) "
//+ "(misc_payables.pay_mode like 'C') AND"
//+ "misc_payables.entry_batch_no like ' '"
+ "ORDER BY MISC_PAYABLES.SUNDRY_TYPE ASC, "
+ "MISC_PAYABLES.SUNDRY_CODE ASC,"
+ "MISC_PAYABLES.REF_NO ASC ";
}
loginUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
termID = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"termId");
tranType = finCommon.getFinparams("999999","TRAN_TYPE_AUTO_PAY",conn);
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
if("NULLFOUND".equalsIgnoreCase(tranType))
tranType = "O";
//getting data from misc_payables
sql="SELECT MISC_PAYABLES.REF_NO,MISC_PAYABLES.TRAN_DATE,MISC_PAYABLES.REF_DATE,MISC_PAYABLES.BILL_NO,"
+ "MISC_PAYABLES.BILL_DATE,MISC_PAYABLES.CURR_CODE,MISC_PAYABLES.EXCH_RATE,MISC_PAYABLES.SUNDRY_CODE,"
+ "MISC_PAYABLES.ACCT_CODE,MISC_PAYABLES.CCTR_CODE,MISC_PAYABLES.DUE_DATE,MISC_PAYABLES.SITE_CODE,"
+ "MISC_PAYABLES.FIN_ENTITY,MISC_PAYABLES.TOT_AMT,MISC_PAYABLES.SUNDRY_TYPE,MISC_PAYABLES.BANK_CODE,"
+ "CASE WHEN MISC_PAYABLES.PAY_MODE IS NULL THEN '' ELSE MISC_PAYABLES.PAY_MODE END as PAY_MODE,MISC_PAYABLES.ADV_AMT,MISC_PAYABLES.TRAN_ID,MISC_PAYABLES.TRAN_SER,MISC_PAYABLES.ADJ_AMT,"
+ "MISC_PAYABLES.HOLD_AMT, fn_confirmed_by(misc_payables.tran_ser, misc_payables.ref_no) as username,"
+ "misc_payables.tot_amt - (case when misc_payables.adj_amt is null then 0 else misc_payables.adj_amt end) - (case when misc_payables.hold_amt is null then 0 else misc_payables.hold_amt end) as net_payable "
+ "FROM MISC_PAYABLES WHERE "
//+ "( misc_payables.sundry_type like '' ) AND"
//+ "( misc_payables.sundry_code like '' ) AND"
+ "( misc_payables.ref_no = ? ) "
//+ "(misc_payables.pay_mode like 'C') AND"
//+ "misc_payables.entry_batch_no like ' '"
+ "ORDER BY MISC_PAYABLES.SUNDRY_TYPE ASC, "
+ "MISC_PAYABLES.SUNDRY_CODE ASC,"
+ "MISC_PAYABLES.REF_NO ASC ";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,tranId );
rs=pstmt.executeQuery();
......@@ -210,151 +251,223 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
netPayable=rs.getDouble("NET_PAYABLE");
sundryCode=rs.getString("sundry_code");
tranSerM=rs.getString("tran_ser");
}
pstmt.close();
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
rs.close();
rs=null;
Timestamp today = new java.sql.Timestamp(System.currentTimeMillis());
sdf = new java.text.SimpleDateFormat(genericUtility.getApplDateFormat());
remarks = "Automatic Payment";
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());
sdf = new java.text.SimpleDateFormat(genericUtility.getApplDateFormat());
remarks = "Automatic Payment";
//bank details
sql = "select acct_code__bal, cctr_code__bal, acct_code__bc, cctr_code__bc,acct_code__cf, "+
"acct_code__cf_ap, cctr_code__cf, cctr_code__cf_ap from bank where bank_code = '"+bankCode+"'";
System.out.println("SQL : "+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
acctCodeBal = rs.getString("acct_code__bal");
cctrCodeBal = rs.getString("cctr_code__bal");
acctCodeBc = rs.getString("acct_code__bc");
cctrCodeBc = rs.getString("cctr_code__bc");
acctCodeCf = rs.getString("acct_code__cf");
acctCodeCfAp = rs.getString("acct_code__cf_ap");
cctrCodeCf = rs.getString("cctr_code__cf");
cctrCodeCfAp = rs.getString("cctr_code__cf_ap");
}
if(acctCodeCfAp == null || acctCodeCfAp.length() == 0)
{
acctCodeCfAp = acctCodeCf;
}
if(cctrCodeCfAp == null || cctrCodeCfAp.length() == 0)
{
cctrCodeCfAp = cctrCodeCf;
}
pstmt.close();
rs.close();
//calculating discount for Voucher
if("VOUCH".equalsIgnoreCase(tranSer))
{
sql="select purc_order,eff_date,bill_date from voucher where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refNo );
rs = pstmt.executeQuery();
if(rs.next())
{
purcOrder=rs.getString("purc_order");
effDate=rs.getTimestamp("eff_date");
}
pstmt.close();
rs.close();
sql="select cr_term from porder where purc_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,purcOrder );
rs = pstmt.executeQuery();
if(rs.next())
{
pCrTerm=rs.getString("cr_term");
}
pstmt.close();
rs.close();
sql="select crtermfc.fin_chg,crterm.acct_code__disc,crterm.cctr_code__disc,crterm.start_from "
+ "from crterm,crtermfc "
+ "where crtermfc.cr_term = crterm.cr_term and crterm.cr_term = ? and trim(crtermfc.line_no) = '1'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,pCrTerm );
rs = pstmt.executeQuery();
if(rs.next())
{
lcDiscount=rs.getDouble("fin_chg");
acctCodeDisc=rs.getString("acct_code__disc");
cctrCodeDisc=rs.getString("cctr_code__disc");
startFrom=rs.getString("start_from");
}
pstmt.close();
rs.close();
ldDiscountDt = calcDiscountDate(pCrTerm,(sdf.format(refDate)),(sdf.format(effDate)),(sdf.format(billDate)),conn);
System.out.println("Test"+ldDiscountDt);
long liDateDiff=dayDiff(ldDiscountDt,today);
sql = "select fin_chg from crtermfc where ? between min_day and max_day and cr_term = ? and trim(line_no) = '1'";
pstmt = conn.prepareStatement(sql);
pstmt.setLong(1, liDateDiff);
pstmt.setString(2, pCrTerm);
rs = pstmt.executeQuery();
if(rs.next())
{
lcDiscount=rs.getDouble(1);
}
pstmt.close();
rs.close();
if(startFrom!=null && startFrom.trim().length()>0 )
{
if("R".equalsIgnoreCase(startFrom))
{
ldStartDate=refDate;
}
else if("D".equalsIgnoreCase(startFrom) || "Q".equalsIgnoreCase(startFrom))
{
ldStartDate=effDate;
}
else if("B".equalsIgnoreCase(startFrom))
{
ldStartDate=billDate;
}
if((today.after(ldStartDate) || today.equals(ldStartDate)) && (today.before(ldDiscountDt) || today.equals(ldDiscountDt)))
{
lcDiscountAmt=(payAmt*lcDiscount)/100;
}
}
}
//calculating total amount
totAmount = totAmt - lcDiscountAmt;
System.out.println("Pay Amt : "+payAmt + "Total Amt : "+totAmt);
//09062007 (set currCode bc with Curr Code
currCodeBc = currCode;
String stanCode=getStanDraw(sundryType, sundryCode, conn);
StringBuffer xmlBuff = new StringBuffer();
sql = "select acct_code__bal, cctr_code__bal, acct_code__bc, cctr_code__bc,acct_code__cf, "+
"acct_code__cf_ap, cctr_code__cf, cctr_code__cf_ap from bank where bank_code = '"+bankCode+"'";
System.out.println("SQL : "+sql);
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(rs.next())
{
acctCodeBal = rs.getString("acct_code__bal");
cctrCodeBal = rs.getString("cctr_code__bal");
acctCodeBc = rs.getString("acct_code__bc");
cctrCodeBc = rs.getString("cctr_code__bc");
acctCodeCf = rs.getString("acct_code__cf");
acctCodeCfAp = rs.getString("acct_code__cf_ap");
cctrCodeCf = rs.getString("cctr_code__cf");
cctrCodeCfAp = rs.getString("cctr_code__cf_ap");
}
if(acctCodeCfAp == null || acctCodeCfAp.length() == 0)
{
acctCodeCfAp = acctCodeCf;
}
if(cctrCodeCfAp == null || cctrCodeCfAp.length() == 0)
{
cctrCodeCfAp = cctrCodeCf;
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
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]
//calculating discount for Voucher
if("VOUCH".equalsIgnoreCase(tranSer))
{
sql="select purc_order,eff_date,bill_date from voucher where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refNo );
rs = pstmt.executeQuery();
if(rs.next())
{
purcOrder=rs.getString("purc_order");
effDate=rs.getTimestamp("eff_date");
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
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 cr_term from porder where purc_order = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,purcOrder );
rs = pstmt.executeQuery();
if(rs.next())
{
pCrTerm=rs.getString("cr_term");
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
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 crtermfc.fin_chg,crterm.acct_code__disc,crterm.cctr_code__disc,crterm.start_from "
+ "from crterm,crtermfc "
+ "where crtermfc.cr_term = crterm.cr_term and crterm.cr_term = ? and trim(crtermfc.line_no) = '1'";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,pCrTerm );
rs = pstmt.executeQuery();
if(rs.next())
{
lcDiscount=rs.getDouble("fin_chg");
acctCodeDisc=rs.getString("acct_code__disc");
cctrCodeDisc=rs.getString("cctr_code__disc");
startFrom=rs.getString("start_from");
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
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]
ldDiscountDt = calcDiscountDate(pCrTerm,(sdf.format(refDate)),(sdf.format(effDate)),(sdf.format(billDate)),conn);
System.out.println("Test"+ldDiscountDt);
long liDateDiff=dayDiff(ldDiscountDt,today);
sql = "select fin_chg from crtermfc where ? between min_day and max_day and cr_term = ? and trim(line_no) = '1'";
pstmt = conn.prepareStatement(sql);
pstmt.setLong(1, liDateDiff);
pstmt.setString(2, pCrTerm);
rs = pstmt.executeQuery();
if(rs.next())
{
lcDiscount=rs.getDouble(1);
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
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(startFrom!=null && startFrom.trim().length()>0 )
{
if("R".equalsIgnoreCase(startFrom))
{
ldStartDate=refDate;
}
else if("D".equalsIgnoreCase(startFrom) || "Q".equalsIgnoreCase(startFrom))
{
ldStartDate=effDate;
}
else if("B".equalsIgnoreCase(startFrom))
{
ldStartDate=billDate;
}
if((today.after(ldStartDate) || today.equals(ldStartDate)) && (today.before(ldDiscountDt) || today.equals(ldDiscountDt)))
{
lcDiscountAmt=(payAmt*lcDiscount)/100;
}
}
}
//calculating total amount
totAmount = totAmt - lcDiscountAmt;
System.out.println("Pay Amt : "+payAmt + "Total Amt : "+totAmt);
//09062007 (set currCode bc with Curr Code
currCodeBc = currCode;
String stanCode=getStanDraw(sundryType, sundryCode, conn);
StringBuffer xmlBuff = new StringBuffer();
xmlBuff.append("<?xml version='1.0' encoding='ISO-8859-1'?>\n");
xmlBuff.append("<DocumentRoot>");
xmlBuff.append("<description>").append("Datawindow Root").append("</description>");
xmlBuff.append("<group0>");
xmlBuff.append("<description>").append("Group0 description").append("</description>");
xmlBuff.append("<Header0>");
if(onConf)
{
xmlBuff.append("<objName><![CDATA[").append("misc_pay_act").append("]]></objName>");
xmlBuff.append("<objName><![CDATA[").append("misc_pay_act").append("]]></objName>");
}
else
{
......@@ -372,10 +485,10 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
xmlBuff.append("<forcedSave><![CDATA[").append(true).append("]]></forcedSave>");
xmlBuff.append("<taxInFocus><![CDATA[").append(false).append("]]></taxInFocus>");
xmlBuff.append("<description>").append("Header0 members").append("</description>");
if(onConf)
{
xmlBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"misc_pay_act\" objContext=\"1\">");
xmlBuff.append("<Detail1 dbID=\"\" domID=\"1\" objName=\"misc_pay_act\" objContext=\"1\">");
}
else
{
......@@ -392,72 +505,96 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
if("Q".equalsIgnoreCase(payMode) || "D".equalsIgnoreCase(payMode))
{
sql = "select chq1,chq2 from bank where bank_code=? and chq1 is not null and chq2 is not null";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, bankCode);
rs = pstmt.executeQuery();
if(rs.next())
{
chq1Str=rs.getString("chq1");
chq2Str=rs.getString("chq2");
}
pstmt.close();
rs.close();
if ( (chq1Str!= null && chq1Str.trim().length()>0) &&(chq2Str!= null && chq2Str.trim().length()>0) )
{
chq1=Double.parseDouble(chq1Str);
chq2=Double.parseDouble(chq2Str);
sql = "select max( to_number(a.ref_no)) from ( select ref_no from banktran_log where bank_code = ? "
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, bankCode);
rs = pstmt.executeQuery();
if(rs.next())
{
chq1Str=rs.getString("chq1");
chq2Str=rs.getString("chq2");
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
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 ( (chq1Str!= null && chq1Str.trim().length()>0) &&(chq2Str!= null && chq2Str.trim().length()>0) )
{
chq1=Double.parseDouble(chq1Str);
chq2=Double.parseDouble(chq2Str);
sql = "select max( to_number(a.ref_no)) from ( select ref_no from banktran_log where bank_code = ? "
+ " and ref_mode = 'Q' and ref_no is not null and ref_no <> ' ') a "
+ " where a.ref_no >= ? and a.ref_no <= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, bankCode);
pstmt.setString(2, chq1Str);
pstmt.setString(3, chq2Str);
rs = pstmt.executeQuery();
if(rs.next())
{
llRefNo=rs.getLong(1);
}
pstmt.close();
rs.close();
if (llRefNo==0)
{
lsRefNo=" ";
}
else
{
if(llRefNo==chq2)
{
lsRefNo=" ";
}
else
{
lsRefNo=Long.toString(llRefNo +1);
if (chq2Str.indexOf(0)==1 )
{
lsRefNo="000000"+lsRefNo.substring(lsRefNo.length()-6);
}
}
}
}
else
{
lsRefNo=" ";
}
xmlBuff.append("<ref_no><![CDATA[" + lsRefNo + "]]></ref_no>");
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, bankCode);
pstmt.setString(2, chq1Str);
pstmt.setString(3, chq2Str);
rs = pstmt.executeQuery();
if(rs.next())
{
llRefNo=rs.getLong(1);
}
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
rs.close()*/
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 (llRefNo==0)
{
lsRefNo=" ";
}
else
{
if(llRefNo==chq2)
{
lsRefNo=" ";
}
else
{
lsRefNo=Long.toString(llRefNo +1);
if (chq2Str.indexOf(0)==1 )
{
lsRefNo="000000"+lsRefNo.substring(lsRefNo.length()-6);
}
}
}
}
else
{
lsRefNo=" ";
}
xmlBuff.append("<ref_no><![CDATA[" + lsRefNo + "]]></ref_no>");
}
//added by Nandkumar Gadkari On 21/06/18------end--------------
if(refDate!=null)// condition added by Nandkumar Gadkari On 21/06/18
{
xmlBuff.append("<ref_date><![CDATA[" + sdf.format(refDate) + "]]></ref_date>");
xmlBuff.append("<ref_date><![CDATA[" + sdf.format(refDate) + "]]></ref_date>");
}
xmlBuff.append("<net_amt><![CDATA[" + totAmount + "]]></net_amt>");
xmlBuff.append("<net_amt__bc><![CDATA[" + totAmount + "]]></net_amt__bc>");
......@@ -478,20 +615,20 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
xmlBuff.append("<cctr_code__cf><![CDATA[" + cctrCodeCfAp + "]]></cctr_code__cf>");
xmlBuff.append("<tax_amt><![CDATA[" + 0 + "]]></tax_amt>");
xmlBuff.append("</Detail1>");
if(onConf)
{
xmlBuff.append("<Detail2 dbID=\"\" domID=\"1\" objName=\"misc_pay_act\" objContext=\"2\">");
xmlBuff.append("<Detail2 dbID=\"\" domID=\"1\" objName=\"misc_pay_act\" objContext=\"2\">");
}
else
{
xmlBuff.append("<Detail2 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"2\">");
xmlBuff.append("<Detail2 dbID=\"\" domID=\"1\" objName=\"misc_pay\" objContext=\"2\">");
}
xmlBuff.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\"/>");
xmlBuff.append("<tran_ser><![CDATA[" + tranSerM+ "]]></tran_ser>");
if(refDate!=null)// condition added by Nandkumar Gadkari On 21/06/18
{
xmlBuff.append("<vouch_date><![CDATA[" + sdf.format(refDate) + "]]></vouch_date>");
xmlBuff.append("<vouch_date><![CDATA[" + sdf.format(refDate) + "]]></vouch_date>");
}
xmlBuff.append("<vouch_no><![CDATA[" + refNo + "]]></vouch_no>");
xmlBuff.append("<net_amt><![CDATA[" + totAmount + "]]></net_amt>");
......@@ -510,23 +647,23 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
xmlBuff.append("<tax_amt><![CDATA[" + 0 + "]]></tax_amt>");
xmlBuff.append("<net_pay_amt><![CDATA[" + totAmount + "]]></net_pay_amt>");
xmlBuff.append("</Detail2>");
xmlBuff.append("</Header0>");
xmlBuff.append("</group0>");
xmlBuff.append("</DocumentRoot>");
System.out.println("xmlBuff.toString() ["+xmlBuff.toString() + "]");
//calling process Request
retString=saveData(xtraParams, siteCode, xmlBuff.toString(),userId, conn);
if( retString.indexOf("Success") != -1 || retString==null)
{
conn.commit();
return (itmDBAccessEJB.getErrorString("","VOUCHSUCC", "", "", conn));
conn.commit();
return (itmDBAccessEJB.getErrorString("","VOUCHSUCC", "", "", conn));
}
}
catch(Exception e)
catch(Exception e)
{
try
{
......@@ -543,6 +680,13 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
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)
{
pstmt1.close();
......@@ -555,7 +699,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
}
if( conn != null && ! conn.isClosed() )
{
/*conn.close();
conn = null;*/
}
......@@ -569,9 +713,9 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
}
System.out.println("Returning Result ::"+retString);
return retString;
}
private Timestamp getCurrdateAppFormat()
......@@ -605,45 +749,45 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
}
private String saveData(String xtraParams,String siteCode, String xmlString,String userId, Connection conn) throws ITMException
{
System.out.println("saving data...........");
InitialContext ctx = null;
String retString = null;
MasterStatefulLocal masterStateful = null; // for ejb3
ibase.utility.UserInfoBean userInfoBean=new UserInfoBean();
try
{
AppConnectParm appConnect = new AppConnectParm();
ctx = new InitialContext(appConnect.getProperty());
masterStateful = (MasterStatefulLocal) ctx.lookup("ibase/MasterStatefulEJB/local");
System.out.println("-----------masterStateful------- " + masterStateful);
String[] authencate = new String[2];
authencate[0] = userId;
authencate[1] = "";
System.out.println("xmlString to masterstateful [" + xmlString + "]");
userInfoBean.setEmpCode(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"));
userInfoBean.setRemoteHost(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
userInfoBean.setSiteCode(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
userInfoBean.setLoginCode(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
userInfoBean.setEntityCode(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"));
retString=masterStateful.processRequest(authencate, siteCode, true, xmlString,true,conn);//ocessRequest(userInfoBean,xmlString,true,conn);
} catch (ITMException itme)
{
System.out.println("ITMException :CreateDistOrder :saveData :==>");
throw itme;
} catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception :CreateDistOrder :saveData :==>");
throw new ITMException(e);
System.out.println("saving data...........");
InitialContext ctx = null;
String retString = null;
MasterStatefulLocal masterStateful = null; // for ejb3
ibase.utility.UserInfoBean userInfoBean=new UserInfoBean();
try
{
AppConnectParm appConnect = new AppConnectParm();
ctx = new InitialContext(appConnect.getProperty());
masterStateful = (MasterStatefulLocal) ctx.lookup("ibase/MasterStatefulEJB/local");
System.out.println("-----------masterStateful------- " + masterStateful);
String[] authencate = new String[2];
authencate[0] = userId;
authencate[1] = "";
System.out.println("xmlString to masterstateful [" + xmlString + "]");
userInfoBean.setEmpCode(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"));
userInfoBean.setRemoteHost(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId"));
userInfoBean.setSiteCode(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"));
userInfoBean.setLoginCode(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
userInfoBean.setEntityCode(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"));
retString=masterStateful.processRequest(authencate, siteCode, true, xmlString,true,conn);//ocessRequest(userInfoBean,xmlString,true,conn);
} catch (ITMException itme)
{
System.out.println("ITMException :CreateDistOrder :saveData :==>");
throw itme;
} catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception :CreateDistOrder :saveData :==>");
throw new ITMException(e);
}
return retString;
}
return retString;
}
private Timestamp calcDiscountDate(String crTerm, String vouchDate, String effDate, String billDate,Connection conn) throws ITMException
{
String discountDate="",sql="",lsStart="",lsMonth="",lsOverridediscdt="";
......@@ -687,7 +831,7 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
Calendar cal = Calendar.getInstance();
cal.setTime(ldTranDt);
liMonth = cal.get(Calendar.MONTH);
if(liMonth==12)
{
liMonth=1;
......@@ -717,10 +861,23 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
sqlCount++;
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;
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+"]");//
if(sqlCount>0)
{
......@@ -745,10 +902,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
lsOverridediscdt=checkNull(rs.getString("override_discount_date"));
liDays=rs.getInt("max_day");
}
pstmt.close();
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
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+"]");
if(sqlCount>0)
{
......@@ -765,10 +934,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
sqlCount++;
liDays=rs.getInt("max_day");
}
pstmt.close();
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][Start]
/*pstmt.close();
pstmt=null;
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)
{
......@@ -799,22 +980,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
long datediff=0;
try
{
/*SimpleDateFormat sdf1=new SimpleDateFormat("dd-MM-yyyy");
/*SimpleDateFormat sdf1=new SimpleDateFormat("dd-MM-yyyy");
String [] a1=(sdf1.format(discountDt)).split("-");
String [] a2=(sdf1.format(paymentDt)).split("-");
System.out.println(Integer.parseInt(a2[2])+""+ Integer.parseInt(a2[1])+""+ Integer.parseInt(a2[0]));
LocalDate discDate = LocalDate.of(Integer.parseInt(a1[2]), Integer.parseInt(a1[1]), Integer.parseInt(a1[0]));
LocalDate payDate = LocalDate.of(Integer.parseInt(a2[2]), Integer.parseInt(a2[1]), Integer.parseInt(a2[0]));
Period diff = Period.between(discDate, payDate);
difference=diff.getDays();
System.out.printf("Difference is %d years, %d months and %d days old",diff.getYears(), diff.getMonths(), diff.getDays());*/
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
Date discdt = sdf.parse(sdf.format(discountDt));
Date mPayDate = sdf.parse(sdf.format(paymentDt));
System.out.println("mPayDate============" + mPayDate);
......@@ -827,10 +1008,10 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
throw new ITMException(e);
}
return datediff;
}
public String getStanDraw(String sundryType, String sundryCode, Connection conn)
throws ITMException
throws ITMException
{
PreparedStatement pstmt = null;
ResultSet rs = null;
......@@ -851,10 +1032,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
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();
pstmt.close();
pstmt = null;
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("StanCode from Sundry type=E>>>>>>" + stanCode);
}
else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("S".equalsIgnoreCase(sundryType)))
......@@ -867,10 +1060,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
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();
pstmt.close();
pstmt = null;
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("StanCode from Sundry type= S>>>>>>" + stanCode);
}
else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("C".equalsIgnoreCase(sundryType)))
......@@ -883,10 +1088,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
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();
pstmt.close();
pstmt = null;
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("StanCode from Sundry type=C>>>>>>" + stanCode);
}
else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("P".equalsIgnoreCase(sundryType)))
......@@ -899,10 +1116,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
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();
pstmt.close();
pstmt = null;
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("empCode from Sundry type=P>>>>>>" + empCode);
......@@ -916,10 +1145,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
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();
pstmt.close();
pstmt = null;
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("StanCode from Sundry type=P>>>>>>" + stanCode);
}
......@@ -934,10 +1175,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
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();
pstmt.close();
pstmt = null;
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("StanCode from Sundry type= T>>>>>>" + stanCode);
}
else if ((sundryType != null) && (sundryType.trim().length() > 0) && ("X".equalsIgnoreCase(sundryType)))
......@@ -950,10 +1203,22 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
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();
pstmt.close();
pstmt = null;
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("StanCode from Sundry type= X>>>>>>" + stanCode);
}
......@@ -968,14 +1233,27 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
{
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;
}
if(rs!=null)
{
rs.close();rs=null;
}
}*/
//Modified by Anjali R. on[28/08/2018][Handle resource leak issue][End]
}
catch(Exception ex)
{
......@@ -986,6 +1264,6 @@ public class VouchPayAct extends ActionHandlerEJB implements VouchPayActLocal, V
return stanCode;
}
}
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