Commit 572f86b2 authored by msingh's avatar msingh

Changed by Manish on 01/04/16 for maximum cursor issue for DDUK .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@39293 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bdfe3775
......@@ -774,6 +774,18 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
serviceCode = rs.getString("SERVICE_CODE");
compName = rs.getString("COMP_NAME");
}
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pStmt != null)
{
pStmt.close();
pStmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1,serviceCode);
......@@ -782,6 +794,18 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
{
serviceURI = rs.getString("SERVICE_URI");
}
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pStmt != null)
{
pStmt.close();
pStmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -818,6 +842,11 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
pStmt.close();
pStmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
if( conn != null ){
conn.close();
conn = null;
......
......@@ -258,6 +258,18 @@ String runMode="";
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -266,6 +278,18 @@ String runMode="";
{
serviceURI = rs.getString("SERVICE_URI");
}
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
Service service = new Service();
Call call = (Call)service.createCall();
......@@ -309,6 +333,11 @@ String runMode="";
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -429,6 +429,18 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -438,6 +450,18 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -479,6 +503,11 @@ public class GeneratePReturnPrc extends ProcessEJB implements GeneratePReturnPrc
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -2261,6 +2261,18 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -2270,6 +2282,18 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -2309,6 +2333,11 @@ public class GenerateSaleOrderPrc extends ProcessEJB implements GenerateSaleOrde
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -5,18 +5,15 @@ import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.MasterStatefulLocal;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.fin.MiscDrCrRcpConf;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.math.BigDecimal;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.HashMap;
......@@ -196,13 +193,6 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
mapDebitNoteAmt.put(lineNo, detail3Amt);
// detail2xmlString=getDetailsXmlString(conn, xtraParams,
// invoiceId, aprvRate, debitNoteAmtDetail);
// make rounding off logic detail3Amt
System.out.println("detail3Amt Before rounding["+detail3Amt+"]");
detail3Amt = getRequiredDecimal(detail3Amt, custCode,conn);
System.out.println("detail3Amt After rounding["+detail3Amt+"]");
detail2xmlString = detail2xmlString
+ getDetailsXmlString(conn, invoiceId, lineNotrace,
lineNo, aprvRate, PODqty, lotNo, lotSl,
......@@ -211,14 +201,13 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
} // end while
System.out.println("detail2xmlString---->>[["
+ detail2xmlString + "]]");
System.out.println("Final detail3AmtT in debit note---Before rounding------->> : ["+ detail3AmtT+"]");
System.out
.println("Final detail3AmtT in debit note---------->> : "
+ detail3AmtT);
// Debit note amount cannot less than hundred.
// [31-JUL-2015] Sanket Girme
if (detail3AmtT >= 100) {
// make roundings off logic detail3AmtT
detail3AmtT = getRequiredDecimal(detail3AmtT, custCode,conn);
System.out.println("Final detail3AmtT in debit note---After rounding------->> : ["+ detail3AmtT+"]");
errString = genDebitNote("POD", invoiceId, custCode,
siteCode, xtraParams, currCode, ExchRate,
detail2xmlString, detail3AmtT, conn);
......@@ -237,20 +226,24 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
if ((errString != null)
&& errString.indexOf("CONFSUCCES") > -1) {
updCnt = updatePodHeader(conn, tranId, loginCode);
System.out.println("return count from updateDebitNoteAmounts--->["
System.out
.println("return count from updateDebitNoteAmounts--->["
+ updCnt + "]");
if (updCnt > 0) {
conn.commit();
errString = itmdbAccess.getErrorString("",
"VTCONSUCF", "", "", conn);
System.out.println("-----@@@Debit Note Generated successfully for amount : "
System.out
.println("------@@@Debit Note Generated successfully for amount : "
+ actualDBamount);
System.out.println("Confirmation of Debit note done successfully----------");
System.out
.println("Confirmation of Debit note done successfully----------");
} else {
errString = itmdbAccess.getErrorString("",
"VTNCONFT", "", "", conn);
conn.rollback();
System.out.println("transaction not confirmed----------");
System.out
.println("transaction not confirmed----------");
}
} else {
errString = itmdbAccess.getErrorString("",
......@@ -267,7 +260,8 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
} else {
errString = itmdbAccess.getErrorString("", "VTCOSUCFT", "",
"", conn);
System.out.println("Debit note generated zero for invoice ID-->>["
System.out
.println("Debit note generated zero for invoice ID-->>["
+ invoiceId + "]");
debitNoteTranID = "";
updCnt = updatePodHeader(conn, tranId, loginCode);
......@@ -877,6 +871,18 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
compName = compName == null ? "" : compName.trim();
System.out.println("serviceCode = [" + serviceCode
+ "] compName [" + compName + "]");
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
......@@ -887,6 +893,18 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
serviceURI = serviceURI == null ? "" : serviceURI.trim();
System.out.println("serviceURI = [" + serviceURI
+ "]---> compName = [" + compName + "]");
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -987,6 +1005,18 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
}
System.out.println("serviceCode = " + serviceCode + " compName "
+ compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, serviceCode);
......@@ -994,7 +1024,20 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
if (rs.next()) {
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = " + serviceURI + " compName = " + compName);
System.out.println("serviceURI = " + serviceURI + " compName = "
+ compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -1052,71 +1095,11 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements
System.out.println("Unable to rollback");
s.printStackTrace();
}
throw new ITMException(e);
}
}
return retString;
}
@SuppressWarnings("finally")
public double getRequiredDecimal(double actVal, String custCode,Connection conn) throws SQLException
{
ResultSet rs = null;
PreparedStatement pstmt = null;
String sql = "",round="";
double roundTo= 0d,reqVal=0d;
java.sql.Timestamp invDate = null;
DistCommon dist = new DistCommon();
try {
sql = " select round,round_to from customer where cust_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
rs = pstmt.executeQuery();
if (rs.next()) {
round = rs.getString("round")==null?"":rs.getString("round").trim();
roundTo = rs.getDouble("round_to");
}
reqVal = dist.getRndamt(actVal, round, roundTo);
// if("R".equals(round)) //Near
// {
//
// }
// else if("X".equals(round)) //Next
// {
// BigDecimal noZero = new BigDecimal(actVal);
// noZero.scale();
// noZero.precision();
// }
// else if("P".equals(round)) //Previous
// {
//
// }
// else if("N".equals(round)) //No Round
// {
// reqVal = actVal;
// }
} catch (Exception e) {
System.out.println("Exception in getRequiredDecimal off Round-------");
e.printStackTrace();
}
// NumberFormat numberFormat = NumberFormat.getIntegerInstance();
// Double DoubleValue = new Double(actVal);
// numberFormat.setMaximumFractionDigits(prec);
// String strValue = numberFormat.format(DoubleValue);
// strValue = strValue.replaceAll(",", "");
// double reqVal = Double.parseDouble(strValue);
finally
{
rs.close();
rs=null;
pstmt.close();
pstmt=null;
return reqVal;
}
}
}
......@@ -481,6 +481,13 @@ public class ConsumeIssueAct extends ActionHandlerEJB implements ConsumeIssueAct
issCriteria = rset.getString(1);
System.out.println("issCriteria :"+issCriteria);
}
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (rset !=null)
{
rset.close();
rset = null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
NodeList detailList = selDataDom.getElementsByTagName("Detail");
int noOfDetails = detailList.getLength();
for(int ctr = 0; ctr < noOfDetails; ctr++)
......@@ -562,6 +569,13 @@ public class ConsumeIssueAct extends ActionHandlerEJB implements ConsumeIssueAct
valueXmlString.append("<acct_code__inv isSrvCallOnChg='0'>").append("<![CDATA[").append(acctCodeInv).append("]]>").append("</acct_code__inv>\r\n");
valueXmlString.append("<cctr_code__inv isSrvCallOnChg='0'>").append("<![CDATA[").append(cctrCodeInv).append("]]>").append("</cctr_code__inv>\r\n");
}
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (rset !=null)
{
rset.close();
rset = null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
if (Double.parseDouble(stockQty) <= quantity1)
{
valueXmlString.append("<quantity isSrvCallOnChg='0'>").append("<![CDATA[").append(stockQty).append("]]>").append("</quantity>\r\n");
......
......@@ -534,6 +534,18 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pStmt != null)
{
pStmt.close();
pStmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1,serviceCode);
......@@ -543,6 +555,18 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pStmt != null)
{
pStmt.close();
pStmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -583,6 +607,11 @@ public class DistIssPrc extends ProcessEJB implements DistIssPrcLocal,DistIssPr
pStmt.close();
pStmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
}
catch(Exception e)
{
......
......@@ -246,7 +246,7 @@ public class POMilestoneCnf
rs = null;
pstmt.close();
pstmt = null;
*/
*/
// xml iterate
Document xmlDataAllDom= null;
if(xmlDataAll != null && xmlDataAll.trim().length()!=0)
......@@ -1453,7 +1453,7 @@ public class POMilestoneCnf
}
/*
/*
sql = " select line_no,site_code,tax_amt,tax_chap,tax_class,tax_env,acct_code__dr," +
" cctr_code__dr from porddet where PURC_ORDER= ? " ;
......@@ -1532,7 +1532,7 @@ public class POMilestoneCnf
pstmt.close();
pstmt = null;
*/
*/
/*
double penaltyAmtDummy= pentlyAmt;
sql = " select tran_id,LINE_NO,ACCT_CODE,CCTR_CODE,AMOUNT,TAX_AMT,EXCH_RATE," +
......@@ -2219,6 +2219,18 @@ public class POMilestoneCnf
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = "+serviceCode+" compName "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,serviceCode);
......@@ -2228,6 +2240,18 @@ public class POMilestoneCnf
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = "+serviceURI+" compName = "+compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pstmt != null)
{
pstmt.close();
pstmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -2270,6 +2294,11 @@ public class POMilestoneCnf
pstmt.close();
pstmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*if( conn != null ){
conn.close();
conn = null;
......
......@@ -2140,12 +2140,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
if (pocomp == true)
{
chgDate = new java.sql.Timestamp(System.currentTimeMillis());
sql = "update porder Set status = 'C' , status_date = ? Where purc_order = ?";
sql = "update porder Set status = 'C' Where purc_order = ?";
pstmtUpd = conn.prepareStatement(sql);
pstmtUpd.setTimestamp(1, chgDate); // update current date on status close by cpatil on 25/01/16
pstmtUpd.setString(2, purcOrder);
pstmtUpd.setString(1, purcOrder);
updCnt = pstmtUpd.executeUpdate();
System.out.println("in update");
if (updCnt != 1)
......@@ -3289,8 +3286,6 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
{
qtySample = qtySampleSiteItem;
}
if (itemSer == null || itemSer.trim().length() == 0)
{
sql = "SELECT ITEM_SER FROM ITEM WHERE ITEM_CODE = ?";
......@@ -3306,27 +3301,6 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmt1.close();
pstmt1 = null;
}
/* Added By Dhiraj R chavan on 7/MAR/2016*/
if(qcReqdSite==null || qcReqdSite.trim().length()==0)
{
System.out.println("####qcReqdSite"+qcReqdSite);
//sql = "SELECT ITEM_SER FROM ITEM WHERE ITEM_CODE = ?";
sql="select (case when qc_reqd is null then 'N' else qc_reqd end) from item where item_code=?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCode);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
qcReqdSite =checkNull(rs1.getString("qc_reqd"));
}
rs1.close();
rs1 = null;
pstmt1.close();
}
System.out.println(">>>qcReqdSite Dj: = " + qcReqdSite);
/* Ended By Dhiraj R chavan on 7/MAR/2016*/
if (procMth != null && procMth.trim().length() > 0)
{
......@@ -7520,6 +7494,18 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
compName = rs.getString("COMP_NAME");
}
System.out.println("serviceCode = " + serviceCode + " compName " + compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pStmt != null)
{
pStmt.close();
pStmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
sql = "SELECT SERVICE_URI FROM SYSTEM_EVENT_SERVICES WHERE SERVICE_CODE = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, serviceCode);
......@@ -7529,6 +7515,18 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
serviceURI = rs.getString("SERVICE_URI");
}
System.out.println("serviceURI = " + serviceURI + " compName = " + compName);
// Changed by Manish on 01/04/16 for max cursor issue [start]
if (pStmt != null)
{
pStmt.close();
pStmt=null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
// Changed by Manish on 01/04/16 for max cursor issue [end]
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceURI));
......@@ -7568,6 +7566,11 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pStmt.close();
pStmt = null;
}
if (rs !=null)
{
rs.close();
rs=null;
}
/*
* if( conn != null ){ conn.close(); conn = null; }
*/
......
......@@ -874,6 +874,18 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
{
try
{
//Changed by Manish on 1-04-2016 to close prepared statement [START]
if(pstmtStock != null)
{
pstmtStock.close();
pstmtStock = null;
}
if(rsStock != null)
{
rsStock.close();
rsStock = null;
}
//Changed by Manish on 1-04-2016 to close prepared statement [END]
//added by chitranjan connStatus if connstatus is true then commit.
if( !isError && connStatus )
{
......@@ -3521,7 +3533,7 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
lineNo++;
sql = " Insert into qc_order_lots (QC_ORDER,LINE_NO,ITEM_CODE,LOT_NO,LOT_SL,LOC_CODE,QUANTITY," +
"UNIT,SAMPLE_QTY,LOCTYPE,LOC_CODE__ISSUE,QORDER_NO,NO_ART,NET_WEIGHT) " +
"UNIT,SAMPLE_QTY,LOCTYPE,LOC_CODE__ISSUE,QORDER_NO,NO_ART,NET_WEIGHT,LOC_CODE) " +
" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmtInsert = conn.prepareStatement(sql);
pstmtInsert.setString(1, qorderNo);
......@@ -3530,7 +3542,7 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
pstmtInsert.setString(4, lotNo);
pstmtInsert.setString(5, lotSl);
// pstmtInsert.setString(6, locationCode);
pstmtInsert.setString(6, locCode);
pstmtInsert.setString(6, qcLotLocCode);
quantity = getUnroundDecimal(quantity, 3);
pstmtInsert.setDouble(7, quantity);
pstmtInsert.setString(8, unit);
......@@ -3540,7 +3552,7 @@ public class StockTransferConf extends ActionHandlerEJB implements StockTransfer
pstmtInsert.setString(12, qorderNo);
pstmtInsert.setDouble(13, noArt);
pstmtInsert.setDouble(14, netWeight);
// pstmtInsert.setString(15, locCode);
pstmtInsert.setString(15, locCode);
updCnt1 = pstmtInsert.executeUpdate();
pstmtInsert.close();
pstmtInsert = null;
......
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