Commit 6b73d77b authored by ajadhav's avatar ajadhav

unclosed connection, statment and resultset to be closed

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@184485 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 19221859
......@@ -1869,7 +1869,7 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(errCode == null || (errCode.trim().length() == 0 && analCode.trim().length() > 0 ))
if((errCode == null || errCode.trim().length() == 0)&& analCode.trim().length() > 0)
{
sql = "SELECT COUNT(*) FROM cctr_anal WHERE cctr_code = ? and anal_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -1939,7 +1939,7 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(errCode == null || (errCode.trim().length() == 0 && analCode1.trim().length() > 0 ))
if((errCode == null || errCode.trim().length() == 0 ) && analCode1.trim().length() > 0 )
{
sql = "SELECT COUNT(*) FROM cctr_anal WHERE cctr_code = ? and anal_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -2009,7 +2009,7 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
if(errCode == null || (errCode.trim().length() == 0 && analCode2.trim().length() > 0 ))
if((errCode == null || errCode.trim().length() == 0) && analCode2.trim().length() > 0)
{
sql = "SELECT COUNT(*) FROM cctr_anal WHERE cctr_code = ? and anal_code = ?";
pstmt = conn.prepareStatement(sql);
......@@ -2325,27 +2325,6 @@ public class MiscVoucherIC extends ValidatorEJB implements MiscVoucherICLocal, M
d.printStackTrace();
throw new ITMException(d);
}
//Add by Ajay Jadhav on 27/04/18:START
finally {
try {
if (conn != null) {
if (rs != null) {
rs.close();
rs = null;
}
if (pstmt != null) {
pstmt.close();
pstmt = null;
}
conn.close();
}
conn = null;
} catch (Exception d) {
d.printStackTrace();
throw new ITMException(d);
}
}
//Add by Ajay Jadhav on 27/04/18:END
}
errString = errStringXml.toString();
return errString;
......
......@@ -577,8 +577,9 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
childNodeName = childNode.getNodeName();
if (childNodeName.equalsIgnoreCase("acct_code"))
{
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom1));
acctCode = checkNull(genericUtility.getColumnValue("acct_code", dom));
System.out.println("siteCode:["+siteCode+"]acctCode:["+acctCode+"]");
errCode = finCommon.isAcctCode(siteCode, acctCode, "", conn);
if(errCode == null || errCode.trim().length() == 0)
{
......@@ -609,7 +610,8 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
else if (childNodeName.equalsIgnoreCase("emp_code"))
{
empCode = checkNull(genericUtility.getColumnValue("emp_code", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom1));
System.out.println("siteCode:["+siteCode+"]empCode:["+empCode+"]");
errCode = finCommon.isEmployee(siteCode, empCode, "", conn);
if(errCode != null && errCode.trim().length() > 0)
{
......@@ -746,27 +748,6 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
e.printStackTrace();
throw new ITMException(e);
}
//Add by Ajay on 02/05/18:START
finally {
try {
if (conn != null) {
if (rs != null) {
rs.close();
rs = null;
}
if (pstmt != null) {
pstmt.close();
pstmt = null;
}
conn.close();
}
conn = null;
} catch (Exception d) {
d.printStackTrace();
throw new ITMException(d);
}
}
//Add by Ajay on 02/05/18:END
return errStringXml.toString();
}
......@@ -1542,27 +1523,6 @@ public class RetainerContractIC extends ValidatorEJB implements RetainerContract
}catch(Exception e)
{
}
//Add by Ajay on 02/05/18:START
finally {
try {
if (conn != null) {
if (rs != null) {
rs.close();
rs = null;
}
if (pstmt != null) {
pstmt.close();
pstmt = null;
}
conn.close();
}
conn = null;
} catch (Exception d) {
d.printStackTrace();
throw new ITMException(d);
}
}
//Add by Ajay on 02/05/18:END
return valueXmlString.toString();
}
......
......@@ -499,10 +499,10 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
{
if(sundryType != null && sundryCode != null)
{
sql1 = "select FN_RSUNDRY_NAME ('?','?','N') as sundry_name from retainer_contract";
sql1 = "select DDF_GET_SUNDRY_NAME (?, ?) as sundry_name from retainer_contract";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, sundryType);
pstmt1.setString(2, sundryCode);
pstmt1.setString(1, sundryCode);
pstmt1.setString(2, sundryType);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
......@@ -1141,13 +1141,12 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
throw new ITMException(d);
}
}
//Changes by Ajay on 02/05/18:START
finally
/*finally
{
System.out.println("Closing Connection....");
try {
if (conn != null && !conn.isClosed()) {
conn.commit();
conn.close();
conn = null;
}
......@@ -1156,8 +1155,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
e.printStackTrace();
return errString;
}
}
////Changes by Ajay on 02/05/18:END
}*/
return errString;
}
......@@ -1582,17 +1580,11 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
//analCode = "";
//empCode = "";
System.out.println("[1]"+netAmt+"[2]"+netAmtBc+"[3]"+billAmt+"[4]"+totTax+"[5]"+totAmt+"[6]"+totTax+"[7]"+billAmt+"[8]"+tranId);
// updating misc voucher header related values
sql = "update misc_voucher set net_amt = ?, net_amt__bc = ?, bill_amt = ?, tax_amt = ?," +
" tot_amt = ?, supp_bill_amt = ? where tran_id = ? ";
sql = "update misc_voucher set bill_amt = ?, supp_bill_amt = ? where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, netAmt);
pstmt.setDouble(2, netAmtBc);
pstmt.setDouble(3, billAmt);
pstmt.setDouble(4, totTax);
pstmt.setDouble(5, totAmt);
pstmt.setDouble(6, billAmt);
pstmt.setString(7, tranId);
pstmt.setDouble(1, billAmt);
pstmt.setDouble(2, billAmt);
pstmt.setString(3, tranId);
cnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
......@@ -1653,7 +1645,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
taxClass = "", taxChap = "", taxEnv = "", apply = "", anKeyCol = "",
oEditTax = "", arg1 = "", arg2 = "", rndOff = "", analCode1 = "", analCode2 = "", deptCode = "",
remarksDet = "", taxClassDet = "", taxChapDet = "", taxEnvDet = "", bankCode = "", projCode = "", billNo = "", temp = "", billDateStr = "", lineNo = "";
String xmlString = "", tranIDSer = "", errString = "", stringxmlInvString="";
String xmlString = "", tranIDSer = "", errString = "", stringxmlInvString="",fromDateStr="",toDateStr="";
Timestamp tranDate = null, effDate = null, chgDate = null, dueDate = null , currDate= null, releaseFrDt = null, releaseToDt = null, taxDate = null, relDate = null, effDate1 = null, billDate = null;
Double amount = 0.0, amt = 0.0, amountDet = 0.0, taxDet = 0.0, netAmtBc = 0.0,
netAmt = 0.0, totTax = 0.0, billAmt= 0.0, exchRate = 0.0, rndTo = 0.0, amtBase = 0.0 ;
......@@ -1687,6 +1679,8 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
effDate1 = Timestamp.valueOf(genericUtility.getValidDateString(effDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
System.out.println("[relDateStr:"+relDateStr+"][relDate"+relDate+"][effDate1Str:"+effDate1Str+"]");
fromDateStr = checkNull(genericUtility.getColumnValue("date__fr", headerDom));
toDateStr = genericUtility.getColumnValue("date__to", headerDom);
System.out.println("----miscVouchAR---hdrMap["+hdrMap+"]");
tranType = hdrMap.get("contract_type");
......@@ -1844,7 +1838,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
xmlBuff.append("<amount>").append("<![CDATA[" + amount + "]]>").append("</amount>");
xmlBuff.append("<curr_code>").append("<![CDATA[" + currCode + "]]>").append("</curr_code>");
xmlBuff.append("<exch_rate>").append("<![CDATA[" + exchRate + "]]>").append("</exch_rate>");
xmlBuff.append("<remarks>").append("<![CDATA[" + "#" +contractId + ", Autogenerated" + "]]>").append("</remarks>");
xmlBuff.append("<remarks>").append("<![CDATA[" + "Against contract id:"+contractId+" from "+fromDateStr+" to "+toDateStr+" "+"]]>").append("</remarks>");
xmlBuff.append("<drcr_flag>").append("<![CDATA[" + drCrFlag + "]]>").append("</drcr_flag>");
xmlBuff.append("<tran_id__rcv>").append("<![CDATA[" + tranIdRcv + "]]>").append("</tran_id__rcv>");
xmlBuff.append("<confirmed>").append("<![CDATA[" + confirmed + "]]>").append("</confirmed>");
......@@ -1930,7 +1924,6 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
projCode = "";
}
System.out.println("amountDet:"+amountDet);
netAmt = amountDet + taxDet;
lineNoCount++;
xmlBuff.append("<Detail2 dbID=\"\" domID=\""+lineNoCount+"\" objContext=\"2\" objName=\"misc_drcr_rcp_dr\">");
xmlBuff.append("<attribute pkNames=\"\" selected=\"N\" status=\"N\" updateFlag=\"A\"/>");
......@@ -1999,7 +1992,8 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
analCode = "";
empCode = "";
sql = "update misc_drcr_rcp set amount = ?, " +
//commented due to amount and amount__bc overwritten
/*sql = "update misc_drcr_rcp set amount = ?, " +
" amount__bc = ? where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, netAmt);
......@@ -2013,7 +2007,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
errCode = "NODATAUPD ";
errString = getMsg("No Data Updated In CRDR_NOTE",errCode, conn);
return errString;
}
}*/
}
}catch (ITMException e)
{
......@@ -2062,7 +2056,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
Timestamp currDate=null, relDate=null, effDate1=null,chgDate=null;
int lineNo = 0;
String chgUser = "", chgTerm = "", tranIDSer = "", siteCode = "",finEntity="", errCode= "",
sql = "", currCode="",projCode="",refNo="";
sql = "", currCode="",projCode="",refNo="",fromDateStr="",toDateStr="";
String cctrCode = "", acctCode="",contractType="",acctCodeDet="",cctrCodeDet="",loginSite="",today="";
double exchRate = 0.0,amount=0.0, amountDet=0.0, totAmt = 0.0;
PreparedStatement pstmt = null;
......@@ -2086,6 +2080,8 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
if(effDate1Str != null) {
effDate1 = Timestamp.valueOf(genericUtility.getValidDateString(effDate1Str, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
fromDateStr = checkNull(genericUtility.getColumnValue("date__fr", headerDom));
toDateStr = genericUtility.getColumnValue("date__to", headerDom);
siteCode = hdrMap.get("site_code");
acctCode = hdrMap.get("acct_code");
......@@ -2165,7 +2161,7 @@ public class RetainerContractReleasePrc extends ProcessEJB implements RetainerCo
xmlBuff.append("<exch_rate>").append("<![CDATA[" + exchRate + "]]>").append("</exch_rate>");
xmlBuff.append("<dr_amt>").append("<![CDATA[" + amount + "]]>").append("</dr_amt>");
xmlBuff.append("<cr_amt>").append("<![CDATA[" + amount + "]]>").append("</cr_amt>");
xmlBuff.append("<remarks>").append("<![CDATA[" +"#" +contractId + ", Autogenerated" + "]]>").append("</remarks>");
xmlBuff.append("<remarks>").append("<![CDATA[" + "Against contract id:"+contractId+" from "+fromDateStr+" to "+toDateStr+" "+"]]>").append("</remarks>");
xmlBuff.append("<reversible>").append("<![CDATA[" + "N" + "]]>").append("</reversible>");
xmlBuff.append("<site_code>").append("<![CDATA[" + siteCode + "]]>").append("</site_code>");
/*xmlBuff.append("<chg_date>").append("<![CDATA[" + today + "]]>").append("</chg_date>");
......
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