Commit 5dcdb0f2 authored by wansari's avatar wansari

Changed by wasim on 05-07-2017 for using same connection inside process...

Changed by wasim on 05-07-2017 for using same connection inside process request method for despatch update.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@105262 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3a2d0f68
......@@ -1043,13 +1043,21 @@ public class ConsolidatToDoc {
pstmt = null;
}
}
System.out.println("BEFORE BATCH UPDATE================");
//Changed by wasim on 05-04-2017 for checking line no graeter than 1 then only executing the query [START]
/*System.out.println("BEFORE BATCH UPDATE================");
pstmt1.executeBatch();
System.out.println("AFTER BATCH UPDATE================");
pstmt1.clearBatch();
pstmt1.clearBatch();*/
System.out.println("BEFORE BATCH UPDATE================"+lineNo);
if(lineNo > 0)
{
pstmt1.executeBatch();
pstmt1.clearBatch();
}
System.out.println("AFTER BATCH UPDATE================");
//Changed by wasim on 05-04-2017 for checking line no graeter than 1 then only executing the query [END]
if(pstmt1 != null)
{
pstmt1.close();
......@@ -1117,19 +1125,26 @@ public class ConsolidatToDoc {
//Changed by Dhanraj on 19-SEP-14 for update despatch tare and filler weight [W14FSUN003]
System.out.println("PTCN ======For updatedespatch method====>> "+ptcn);
//Changed by Manish on 19/04/16 [start]
connDriver = new ConnDriver();
tempConn = connDriver.getConnectDB("DriverITM");
connDriver = null;
//Changed by wasim on 05-04-2017 for using same connection so commented [START]
//connDriver = new ConnDriver();
//tempConn = connDriver.getConnectDB("DriverITM");
//connDriver = null;
//Changed by wasim on 05-04-2017 for using same connection so commented [END]
// errString = updatedespatch(ptcn, conn);
errString = updatedespatch(ptcn, tempConn);
//Changed by wasim on 05-04-2017 for using same connection
//errString = updatedespatch(ptcn, tempConn);
errString = updatedespatch(ptcn, conn);
//Changed by Manish on 19/04/16 [end]
//Changed by Dharnaj on 19-SEP-14 for [W14FSUN003]
//sqlHdr = "update despatch set gross_weight = ?, tare_weight = ? ,nett_weight = ?, no_art = ? where desp_id = ? "; //added by Kunal on 08/09/12 as per S Manoharan Sir instruction
sqlHdr = "update despatch set gross_weight = ?, tare_weight = tare_weight + ? ,nett_weight = ?, no_art = ? where desp_id = ? "; //added by Kunal on 08/09/12 as per S Manoharan Sir instruction
// pstmtHdr = conn.prepareStatement(sqlHdr);
pstmtHdr = tempConn.prepareStatement(sqlHdr);
//Changed by wasim on 05-04-2017 for using same connection
//pstmtHdr = tempConn.prepareStatement(sqlHdr);
pstmtHdr = conn.prepareStatement(sqlHdr);
pstmtHdr.setDouble(1, totalGrossWeight);
pstmtHdr.setDouble(2, totalTareWeight);
pstmtHdr.setDouble(3, totalNetWeight);
......@@ -1137,18 +1152,20 @@ public class ConsolidatToDoc {
pstmtHdr.setString(5, despId);
int upctr = pstmtHdr.executeUpdate();
System.out.println("NO OF ROW UPDATED = "+upctr);
if(upctr>0)
//Changed by wasim on 05-04-2017 for using same connection [START]
/*if(upctr>0)
{
tempConn.commit();
}
else
{
tempConn.rollback();
}
}*/
//tempConn.close();
//tempConn = null;
//Changed by wasim on 05-04-2017 for using same connection [END]
pstmtHdr.close();
pstmtHdr = null;
tempConn.close();
tempConn = null;
System.out.println("***************START***********************");
//Changed by Rohan on 10-06-12 to get reports for hazardous material.start
......
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