Commit 2cae14d7 authored by ssalve's avatar ssalve

Sarita: Done changes to close preparestatement and resultset after while statement on 28 JUN 18

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@186994 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7cc200c7
package ibase.webitm.ejb.fin;
import ibase.system.config.AppConnectParm;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
......@@ -105,6 +103,13 @@ AssetSalesConfLocal,AssetSalesConfRemote
double remValues = 0;
HashMap<String , String> retErrTypeValue = new HashMap<String,String>();
//Added by sarita on 19 JUN 18 to store values of asset_register [END]
//Added by sarita on 26 JUN 18 [START]
String sql1 = "", sql2 = "", sql3 = "", sql4 = "", sql5 = "", sql6 = "", sql7 = "", sql8 = "", sql9 = "", sql10 = "", sql11 = "", sql12 = "", sql13 = "";
PreparedStatement pstmt1 = null,pstmt2 = null, pstmt3 = null, pstmt4 = null, pstmt5 = null, pstmt6 = null, pstmt7 = null, pstmt8 = null, pstmt9 = null, pstmt10 = null, pstmt11 = null, pstmt12 = null, pstmt13 = null;
ResultSet rs1 = null,rs2 = null, rs3 = null, rs4 = null, rs5 = null, rs6 = null, rs9 = null, rs10 = null, rs11 = null, rs12 = null;
//Added by sarita on 26 JUN 18 [END]
try
{
ConnDriver connDriver = null;
......@@ -160,8 +165,8 @@ conn = getConnection();
System.out.println("Current Date is :::["+currentDate+"]"); //Current Date is :::[2018-06-06 00:00:00.0]
//Added by sarita to get Current Date in dbformat [END]
if(confirmed == "" || confirmed.equalsIgnoreCase("N"))
// Commented and added if statement to give naming to rs and pstmt and close them after while statement by sarita on 26 JUN 18 [START]
/*if(confirmed == "" || confirmed.equalsIgnoreCase("N"))
{
sql = "select item_ser, item_code , grp_code, site_code, proc_date_2"
......@@ -344,7 +349,7 @@ conn = getConnection();
}
else*/
//Commented by sarita on 19 JUN 18 to comment errormessage and else statement[END]
if(calc_depreciation == true)
/*if(calc_depreciation == true)
{
//Added & Commented by sarita on 19 JUN 18 to commit transaction if calc_depreciation = true & create tabxml & xml file[nvo_business_object_fin_asset_sales] and pass to confirmJournalVoucher method [START]
conn.commit();
......@@ -445,7 +450,7 @@ conn = getConnection();
return errString;
}*/
//Added & Commented by sarita on 19 JUN 18 to commit transaction if calc_depreciation = true & create tabxml & xml file[nvo_business_object_fin_asset_sales] and pass to confirmJournalVoucher method [END]
}
//}
//commented below code for avoiding tax calculation by varsha v on 24-05-18
/*System.out.println("calling taxCalc");
retString = taxCal.taxCalc(transer, tranId, currAppdate, "sale_amt", "", currCode, siteCode, "2");
......@@ -462,7 +467,7 @@ conn = getConnection();
sql = "select item_code, item_ser, total_value, excise_amt, wdv_amt_2, depr_amt_2, grp_code, depr_amt_revl_2 from asset_register where asset_code = ?";
/*sql = "select item_code, item_ser, total_value, excise_amt, wdv_amt_2, depr_amt_2, grp_code, depr_amt_revl_2 from asset_register where asset_code = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, assetCode);
rs = pstmt.executeQuery();
......@@ -645,36 +650,508 @@ conn = getConnection();
pstmt.close();
pstmt = null;
}*/
if(confirmed == "" || confirmed.equalsIgnoreCase("N"))
{
sql1 = "select item_ser, item_code , grp_code, site_code, proc_date_2"
+ " from asset_register where asset_code = ?";
pstmt1=conn.prepareStatement(sql1);
pstmt1.setString(1,assetCode);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
itmSer = rs1.getString(1) == null ? "":rs1.getString(1);
itmCode = rs1.getString(2) == null ? "":rs1.getString(2);
grpCode = rs1.getString(3) == null ? "":rs1.getString(3);
siteCode = rs1.getString(4) == null ? "":rs1.getString(4);
procDate2ts = rs1.getTimestamp(5); // Format procDate2ts :2012-06-01 00:00:00.0
}
pstmt1.clearParameters();
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
procDate2d = sdf.format(procDate2ts); // procDate2d : [01/06/12]
sql2 = "select prd_code__upto from asset_depr"
+ " where asset_code = ? and item_ser = ? and grp_code= ? and site_code = ?";
pstmt2=conn.prepareStatement(sql2);
pstmt2.setString(1,assetCode);
pstmt2.setString(2,itmSer);
pstmt2.setString(3,grpCode);
pstmt2.setString(4,siteCode);
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
prdCdUpto = rs2.getString(1) == null ? "":rs2.getString(1);
}
pstmt2.clearParameters(); System.out.println(">>>>PERIOD CODE UP TO>>>"+prdCdUpto);
if(prdCdUpto == "" || prdCdUpto.trim().length() == 0 )
{
//changes by sarita on 06 JUNE 2018 to add setTimestamp
//sql = "select code from period where '"+procDate2d+"' between fr_date and to_date";
sql3 = "select code from period where ? between fr_date and to_date";
pstmt3=conn.prepareStatement(sql3);
//Added by sarita on 06 JUN 2018
pstmt3.setTimestamp(1,procDate2ts);
rs3 = pstmt3.executeQuery();
if(rs3.next())
{
prdCdUpto = rs3.getString(1) == null ? "":rs3.getString(1);
}
pstmt3.clearParameters();
//changes by sarita on 06 JUN 2018 to set current date Timestamp parameter
//sql = "select code from period where fr_date = (select fr_date from period where code = (select acct_prd from period where '"+currAppdate+"' between fr_date and to_date))";
sql4 = "select code from period where fr_date = (select fr_date from period where code = (select acct_prd from period where ? between fr_date and to_date))";
pstmt4=conn.prepareStatement(sql4);
//Added by sarita on 06 JUN 2018
pstmt4.setTimestamp(1,currentDate);
rs4 = pstmt4.executeQuery();
if(rs4.next())
{
prdCdUpfr = rs4.getString(1) == null ? "":rs4.getString(1);
}
pstmt4.clearParameters();
System.out.println("prdCdUpfr.compareTo(prdCdUpto) > 0 >>> prdCdUpfr "+prdCdUpfr+">>>>>prdCdUpto"+prdCdUpto);
if(prdCdUpfr.compareTo(prdCdUpto) > 0)
{
prdCdUpto = prdCdUpfr;
}
else
}//End of if block for prdCdUpto
//changes by sarita on 06 JUN 2018 to set current date Timestamp parameter
//sql = "select code from period where '"+currAppdate+"' between fr_date and to_date";
sql5 = "select code from period where ? between fr_date and to_date";
pstmt5=conn.prepareStatement(sql5);
//Added by sarita on 06 JUN 2018
pstmt5.setTimestamp(1,currentDate);
rs5 = pstmt5.executeQuery();
if(rs5.next())
{
System.out.println("already confirmed transaction");
errString = itmdbAccess.getErrorString("", "VTFAPOST", "", "", conn);
saleCd = rs5.getString(1) == null ? "":rs5.getString(1);
}
pstmt5.clearParameters();
System.out.println("saleCd.compareTo(prdCdUpto) >= 0 >>> sale cd"+saleCd+">>>>>"+prdCdUpto);
//Added by sarita on 19 JUN 18 to store asset_register values before update [START]
sql6 = "select rem_date , status , tran_id__rem, tran_ser__rem, rem_value from asset_register where asset_code = ?";
pstmt6=conn.prepareStatement(sql6);
pstmt6.setString(1,assetCode);
rs6 = pstmt6.executeQuery();
if(rs6.next())
{
remDate= rs6.getTimestamp("rem_date");
status = rs6.getString("status");
tranIdRem = rs6.getString("tran_id__rem");
tranSerRem = rs6.getString("tran_ser__rem");
remValues = rs6.getDouble("rem_value");
}
System.out.println("Origional Values of asset_register are : rem_date["+remDate+"] \t status["+status+"] \t tran_id__rem["+tranIdRem+"] \t tran_ser__rem["+tranSerRem+"] \t rem_value["+remValues+"]");
pstmt6.clearParameters();
//Added by sarita on 19 JUN 18 to store asset_register values before update [END]
if(saleCd.compareTo(prdCdUpto) >= 0)
{
sql7 = "update asset_register set rem_date = ?,status=?,tran_id__rem=?,tran_ser__rem=?,rem_value=? where asset_code = ?";
pstmt7=conn.prepareStatement(sql7);
//pstmt.setString(1, currAppdate);//Added by sarita to set current date Timestamp parameter on 06 JUN 2018
pstmt7.setTimestamp(1, currentDate);
pstmt7.setString(2, "S");
pstmt7.setString(3, tranId);
pstmt7.setString(4, transer);
pstmt7.setDouble(5, saleAmt);
pstmt7.setString(6, assetCode);
int chk = pstmt7.executeUpdate();
if(chk > 0)
{
System.out.println("Records Updated");
}
pstmt7.clearParameters();
}//end of if for (saleCd.compareTo(prdCdUpto) >= 0)
calc_depreciation = false;
if(prdCdUpto.compareTo(saleCd) >= 0)
{
calc_depreciation = false;
}
else if (saleCd.compareTo(prdCdUpto) > 0)
{
calc_depreciation = true;
}
//Commented by sarita on 19 JUN 18 to comment errormessage and else statement[START]
/*if(calc_depreciation == false)
{
errString = itmdbAccess.getErrorString("", "VTASSTSALE", "", "", conn);
return errString;
}
else*/
//Commented by sarita on 19 JUN 18 to comment errormessage and else statement[END]
if(calc_depreciation == true)
{
//Added & Commented by sarita on 19 JUN 18 to commit transaction if calc_depreciation = true & create tabxml & xml file[nvo_business_object_fin_asset_sales] and pass to confirmJournalVoucher method [START]
conn.commit();
SimpleDateFormat sdf2 = new SimpleDateFormat(genericUtility.getApplDateFormat());
currentDateTime = sdf2.format(today); System.out.println("Current Date Time in Application Format : ["+currentDateTime+"]");
StringBuffer recTabStrBuff = new StringBuffer();//data from d_depr_proc_month.srd
recTabStrBuff.append(siteCode).append("\t"); //site_code
recTabStrBuff.append(itmSer).append("\t"); //item_ser__fr
recTabStrBuff.append(itmSer).append("\t"); //item_ser__to
recTabStrBuff.append(grpCode).append("\t"); //grp_code__fr
recTabStrBuff.append(grpCode).append("\t"); //grp_code__to
recTabStrBuff.append(itmCode).append("\t"); //item_code__fr
recTabStrBuff.append(itmCode).append("\t"); //item_code__to
recTabStrBuff.append(assetCode).append("\t"); //asset_code__fr
recTabStrBuff.append(assetCode).append("\t"); //asset_code__to
recTabStrBuff.append(prdCdUpto).append("\t"); //prd_code__upto
recTabStrBuff.append(purpose).append("\t"); //purpose
recTabStrBuff.append(deprMethod).append("\t"); //depr_method
recTabStrBuff.append(confirm).append("\t"); //confirm
recTabStrBuff.append(commitFlag).append("\t"); //commit_flag
recTabStrBuff.append(assetSrc).append("\t"); //asset_source
recTabStrBuff.append(currentDateTime).append("\t"); //post_date with Application Date Format
xmlTabString = recTabStrBuff.toString();System.out.println(">>>xmlTabString:"+xmlTabString);
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?><Root><header><editFlag>");
valueXmlString.append("").append("</editFlag></header>");
valueXmlString.append("<Detail1>");
valueXmlString.append("<site_code>").append(siteCode).append("</site_code>\r\n");
valueXmlString.append("<item_ser__fr>").append(itmSer).append("</item_ser__fr>\r\n");
valueXmlString.append("<item_ser__to>").append(itmSer).append("</item_ser__to>\r\n");
valueXmlString.append("<grp_code__fr>").append(grpCode).append("</grp_code__fr>\r\n");
valueXmlString.append("<grp_code__to>").append(grpCode).append("</grp_code__to>\r\n");
valueXmlString.append("<item_code__fr>").append(itmCode).append("</item_code__fr>\r\n");
valueXmlString.append("<item_code__to>").append(itmCode).append("</item_code__to>\r\n");
valueXmlString.append("<asset_code__fr>").append(assetCode).append("</asset_code__fr>\r\n");
valueXmlString.append("<asset_code__to>").append(assetCode).append("</asset_code__to>\r\n");
valueXmlString.append("<prd_code__upto>").append(prdCdUpto).append("</prd_code__upto>\r\n");
valueXmlString.append("<purpose>").append(purpose).append("</purpose>\r\n");
valueXmlString.append("<depr_method>").append(deprMethod).append("</depr_method>\r\n");
valueXmlString.append("<confirm>").append(confirm).append("</confirm>\r\n");
valueXmlString.append("<commit_flag>").append(commitFlag).append("</commit_flag>\r\n");
valueXmlString.append("<asset_source>").append(assetSrc).append("</asset_source>\r\n");
valueXmlString.append("<post_date>").append(currentDateTime).append("</post_date>\r\n");
valueXmlString.append("</Detail1>");
valueXmlString.append("</Root>");
finalXmlString = valueXmlString.toString();System.out.println(">>>finalXmlString:"+finalXmlString);
retString = confirmJournalVoucher("depr_proc_month", tranId, xtraParams, xmlTabString,finalXmlString, conn);
System.out.println("ReturnString of confirmJournalVoucher is :\n" +retString );
if((retString != null && retString.trim().length() > 0) && (retString.indexOf("Errors") > -1))
{
retErrTypeValue = getErrorTypeVal(retString); System.out.println("Values in HashMap[retErrTypeValue] are : ["+retErrTypeValue+"]");
for (String errType : retErrTypeValue.keySet())
{
if("E".equalsIgnoreCase(errType) || "W".equalsIgnoreCase(errType))
{
errCode = retErrTypeValue.get(errType); System.out.println("errCode is ["+errCode+"]");
//Added by sarita to update original values if error occurred on retString on 19 JUN 18 [START]
sql8 = "update asset_register set rem_date = ?,status=?,tran_id__rem=?,tran_ser__rem=?,rem_value=? where asset_code = ?";
pstmt8=conn.prepareStatement(sql8);
pstmt8.setTimestamp(1, remDate);
pstmt8.setString(2, status);
pstmt8.setString(3, tranIdRem);
pstmt8.setString(4, tranSerRem);
pstmt8.setDouble(5, remValues);
pstmt8.setString(6, assetCode);
int chkData = pstmt8.executeUpdate();
if(chkData > 0)
{
System.out.println("["+chkData+"] Updated Origional Values to asset_register are : rem_date["+remDate+"] \t status["+status+"] \t tran_id__rem["+tranIdRem+"] \t tran_ser__rem["+tranSerRem+"] \t rem_value["+remValues+"]");
}
pstmt8.clearParameters();
//Added by sarita to update original values if error occurred on retString on 19 JUN 18 [END]
errString = itmdbAccess.getErrorString("", errCode, "", "", conn); System.out.println("errString :>>kkk"+errString);
return errString;
}//end of if for errType
}//end of for loop
}//end of if for retString
}//end of if for calc_depreciation
sql9 = "select item_code, item_ser, total_value, excise_amt, wdv_amt_2, depr_amt_2, grp_code, depr_amt_revl_2 from asset_register where asset_code = ?";
pstmt9=conn.prepareStatement(sql9);
pstmt9.setString(1, assetCode);
rs9 = pstmt9.executeQuery();
if(rs9.next())
{
itmCode = rs9.getString(1) == null ? "":rs9.getString(1);
itmSer = rs9.getString(2) == null ? "":rs9.getString(2);
totval = rs9.getDouble(3);
exciseAmt = rs9.getDouble(4);
wdvAmt2 = rs9.getDouble(5);
depramt = rs9.getDouble(6);
grpCode = rs9.getString(7) == null ? "":rs9.getString(7);
depramtrevl = rs9.getDouble(8);
}
pstmt9.clearParameters();
sql10 = "select sum(case when revalue_amt is null then 0 else revalue_amt end) from asset_revalue where asset_code = ? and confirmed = ?";
pstmt10=conn.prepareStatement(sql10);
pstmt10.setString(1, assetCode);
pstmt10.setString(2, "Y");
rs10 = pstmt10.executeQuery();
if(rs10.next())
{
revalamt = rs10.getDouble(1);
}
pstmt10.clearParameters();
// Total Cost is Total Value + Ravalued Amount
totval = totval + revalamt;
//ldDate = procdate;
pdate = formatter.parse(procDate2d); //Jun 01 00:00:00 GMT+05:30 18
cdate = formatter.parse(currAppdate);
System.out.println("procDate2d : ["+procDate2d+"] \t currAppdate : ["+currAppdate+"] \t pdate : ["+pdate+"] \t cdate ["+cdate+"]");
do
{
pdate = addMonths(pdate, 3);
System.out.println("Pdate is >>>>"+pdate);
System.out.println("CDate is >>>>"+cdate);
cnt = cnt + 1;
if(pdate.compareTo(cdate) >= 0)
{
System.out.println("BREAK>>>>>");
break;
}
} while (true);
System.out.println("loop exit>>cnt val"+cnt);
modVat = ((totval * 2.5) / 100) * cnt;
System.out.println("((totval * 2.5) / 100) * cnt = "+ modVat);
modVat = totval - modVat;
System.out.println("totval - modVat = "+ modVat);
sql11 = "select rtrim(var_value) from finparm where prd_code = ? and var_name = ?";
pstmt11=conn.prepareStatement(sql11);
pstmt11.setString(1, "999999");
pstmt11.setString(2, "FA_OLD_MODVAT");
rs11 = pstmt11.executeQuery();
if(rs11.next())
{
varVal = rs11.getString(1) == null ? "":rs11.getString(1);
}
pstmt11.clearParameters();
if(varVal == null || varVal.equals("N"))
{
sql12 = "select excreco_amt from asset_sales_hdr where tran_id = ?";
pstmt12=conn.prepareStatement(sql12);
pstmt12.setString(1, tranId);
rs12 = pstmt12.executeQuery();
if(rs12.next())
{
modVat = rs12.getDouble(1);
}
pstmt12.clearParameters();
}
proLoss = (saleAmt + depramt + depramtrevl) - (totval + modVat + taxAmt);
System.out.println("(saleAmt + depramt + depramtrevl) - (totval + modVat + taxAmt) = "+proLoss);
if(proLoss > 0)
{
if(acctCdPl != null && acctCdPl.trim().length() > 0)
{
cctrCode = cctrCdPl;
acctCode = acctCdPl;
}
else
{
getAcctCctrPl = finCommon.getAcctDetrTtype(itmCode, itmSer, "FA-PL", tranType, conn);
if(getAcctCctrPl.equals(" , ") || getAcctCctrPl.equals(","))
{
acctCode = "";
cctrCode = "";
}
else
{
acctCctr = getAcctCctrPl.split(",");
acctCode = acctCctr[0];
cctrCode = acctCctr[1];
}
}
}
else
{
if(acctCdLoss != null && acctCdLoss.trim().length() > 0)
{
cctrCode = cctrCdLoss;
acctCode = acctCdLoss;
}
else
{
getAcctCctrLo = finCommon.getAcctDetrTtype(itmCode, itmSer, "FA-LOSS", tranType, conn);
if(getAcctCctrLo.equals(" , ") || getAcctCctrLo.equals(","))
{
acctCode = "";
cctrCode = "";
}
else
{
acctCctr = getAcctCctrLo.split(",");
acctCode = acctCctr[0];
cctrCode = acctCctr[1];
}
}
}
String errshow = gbfAssetSalePost(tranId, transer, lineNo, conn);
System.out.println(">>>>ERR STRING CALL>>"+errshow);
if(errshow.length() > 0)
{
System.out.println("mahesh called method");
errString = itmdbAccess.getErrorString("", "", "", "", conn);
return errString;
}
sql13 = "update asset_register set profit_loss = ? where asset_code = ?";
pstmt13=conn.prepareStatement(sql13);
pstmt13.setDouble(1, proLoss);
pstmt13.setString(2, assetCode);
pstmt13.executeUpdate();
pstmt13.clearParameters();
}//end of if for confirmed
// Commented and added if statement to give naming to rs and pstmt and close them after while statement by sarita on 26 JUN 18 [END]
else
{
System.out.println("already confirmed transaction");
errString = itmdbAccess.getErrorString("", "VTFAPOST", "", "", conn);
return errString;
}
}//end of while statement
//Added by sarita on 26 JUN 18 to close resultset and preparestatement [START]
if (rs1 != null) {
rs1.close();
rs1 = null;
}
if (pstmt1 != null) {
pstmt1.close();
pstmt1 = null;
}
if (rs2 != null) {
rs2.close();
rs2 = null;
}
if (pstmt2 != null) {
pstmt2.close();
pstmt2 = null;
}
if (rs3 != null) {
rs3.close();
rs3 = null;
}
if (pstmt3 != null) {
pstmt3.close();
pstmt3 = null;
}
if (rs4 != null) {
rs4.close();
rs4 = null;
}
if (pstmt4 != null) {
pstmt4.close();
pstmt4 = null;
}
if (rs5 != null) {
rs5.close();
rs5 = null;
}
if (pstmt5 != null) {
pstmt5.close();
pstmt5 = null;
}
if (rs6 != null) {
rs6.close();
rs6 = null;
}
if (pstmt6 != null) {
pstmt6.close();
pstmt6 = null;
}
if (pstmt7 != null) {
pstmt7.close();
pstmt7 = null;
}
if (rs9 != null) {
rs9.close();
rs9 = null;
}
if (pstmt9 != null) {
pstmt9.close();
pstmt9 = null;
}
if (rs10 != null) {
rs10.close();
rs10 = null;
}
if (pstmt10 != null) {
pstmt10.close();
pstmt10 = null;
}
if (rs11 != null) {
rs11.close();
rs11 = null;
}
if (pstmt11 != null) {
pstmt11.close();
pstmt11 = null;
}
if (rs12 != null) {
rs12.close();
rs12 = null;
}
if (pstmt12 != null) {
pstmt12.close();
pstmt12 = null;
}
if (pstmt13 != null) {
pstmt13.close();
pstmt13 = null;
}
//Added by sarita on 26 JUN 18 to close resultset and preparestatement [END]
//Commented by sarita on 26 JUN 18 to use if condition to close rs and pstmt[START]
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
/*pstmt.close();
rs.close();
pstmt = null;
rs = null;
rs = null;*/
//Commented by sarita on 26 JUN 18 to use if condition to close rs and pstmt[END]
if(proLoss > 0)
{
sql = "update asset_sales_hdr set amount_profit = ? where tran_id = ?";
sql= "update asset_sales_hdr set amount_profit = ? where tran_id = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setDouble(1, Math.abs(proLoss));
pstmt.setString(2, tranId);
pstmt.executeUpdate();
//Added and Commented by sarita on 26 JUN 18 [START]
/*pstmt.close();
pstmt = null;*/
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and Commented by sarita on 26 JUN 18 [START]
}
else
{
......@@ -683,9 +1160,16 @@ conn = getConnection();
pstmt.setDouble(1, Math.abs(proLoss));
pstmt.setString(2, tranId);
pstmt.executeUpdate();
//Added and Commented by sarita on 26 JUN 18 [START]
/*pstmt.close();
pstmt = null;*/
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and Commented by sarita on 26 JUN 18 [START]
}
sql = "update asset_sales_hdr set confirmed = ?,conf_date = ?,emp_code__aprv = ? where tran_id = ?";
pstmt=conn.prepareStatement(sql);
......@@ -700,11 +1184,16 @@ conn = getConnection();
{
System.out.println("asset_sales Records Updated");
}
//Added and Commented by sarita on 26 JUN 18 [START]
/*pstmt.close();
pstmt = null;*/
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added and Commented by sarita on 26 JUN 18 [START]
}//end of try block
catch(Exception e)
{
e.printStackTrace();
......@@ -723,6 +1212,100 @@ conn = getConnection();
pstmt.close();
pstmt = null;
}
//Added by sarita to close resultset and preparestatement on 26 JUN 18 [START]
if (rs1 != null) {
rs1.close();
rs1 = null;
}
if (pstmt1 != null) {
pstmt1.close();
pstmt1 = null;
}
if (rs2 != null) {
rs2.close();
rs2 = null;
}
if (pstmt2 != null) {
pstmt2.close();
pstmt2 = null;
}
if (rs3 != null) {
rs3.close();
rs3 = null;
}
if (pstmt3 != null) {
pstmt3.close();
pstmt3 = null;
}
if (rs4 != null) {
rs4.close();
rs4 = null;
}
if (pstmt4 != null) {
pstmt4.close();
pstmt4 = null;
}
if (rs5 != null) {
rs5.close();
rs5 = null;
}
if (pstmt5 != null) {
pstmt5.close();
pstmt5 = null;
}
if (rs6 != null) {
rs6.close();
rs6 = null;
}
if (pstmt6 != null) {
pstmt6.close();
pstmt6 = null;
}
if (pstmt7 != null) {
pstmt7.close();
pstmt7 = null;
}
if (pstmt8 != null) {
pstmt8.close();
pstmt8 = null;
}
if (rs9 != null) {
rs9.close();
rs9 = null;
}
if (pstmt9 != null) {
pstmt9.close();
pstmt9 = null;
}
if (rs10 != null) {
rs10.close();
rs10 = null;
}
if (pstmt10 != null) {
pstmt10.close();
pstmt10 = null;
}
if (rs11 != null) {
rs11.close();
rs11 = null;
}
if (pstmt11 != null) {
pstmt11.close();
pstmt11 = null;
}
if (rs12 != null) {
rs12.close();
rs12 = null;
}
if (pstmt12 != null) {
pstmt12.close();
pstmt12 = null;
}
if (pstmt13 != null) {
pstmt13.close();
pstmt13 = null;
}
//Added by sarita to close resultset and preparestatement on 26 JUN 18 [START]
if (conn != null) {
conn.close();
}
......@@ -972,6 +1555,8 @@ conn = getConnection();
lsAcctCode = lsAcctCode == null ? "" : lsAcctCode.trim();
System.out.println("lsCctrCode ["+lsCctrCode+"] \t lsAcctCode ["+lsAcctCode+"]");
if(lsAcctCode.length() == 0){
lsErrcode = "VTACCTCD1";
}
......@@ -1264,7 +1849,10 @@ conn = getConnection();
glReceivables.put("item_ser",lsItemSer);
glReceivables.put("mrp_value",0);
glReceivables.put("gp_no","");
glReceivables.put("gp_date","");
//changes by sarita on 28 JUN 18 to set gp_date to ldEffDate[START]
//glReceivables.put("gp_date","");
glReceivables.put("gp_date",ldEffDate);
//changes by sarita on 28 JUN 18 to set gp_date to ldEffDate[END]
glReceivables.put("cust_ref_no","");
glReceivables.put("cust_ref_date","");
glReceivables.put("cust_ref_amt","");
......@@ -1340,6 +1928,18 @@ conn = getConnection();
}
}
}
//Added by sarita on 26 JUN 18 [START]
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//Added by sarita on 26 JUN 18 [END]
}
if(lcDeprAmtRevl2 != 0){
......
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