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
...@@ -1044,11 +1044,19 @@ public class ConsolidatToDoc { ...@@ -1044,11 +1044,19 @@ public class ConsolidatToDoc {
} }
} }
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(); pstmt1.executeBatch();
System.out.println("AFTER BATCH UPDATE================"); System.out.println("AFTER BATCH UPDATE================");
pstmt1.clearBatch();*/
System.out.println("BEFORE BATCH UPDATE================"+lineNo);
if(lineNo > 0)
{
pstmt1.executeBatch();
pstmt1.clearBatch(); 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) if(pstmt1 != null)
{ {
...@@ -1117,19 +1125,26 @@ public class ConsolidatToDoc { ...@@ -1117,19 +1125,26 @@ public class ConsolidatToDoc {
//Changed by Dhanraj on 19-SEP-14 for update despatch tare and filler weight [W14FSUN003] //Changed by Dhanraj on 19-SEP-14 for update despatch tare and filler weight [W14FSUN003]
System.out.println("PTCN ======For updatedespatch method====>> "+ptcn); System.out.println("PTCN ======For updatedespatch method====>> "+ptcn);
//Changed by Manish on 19/04/16 [start] //Changed by Manish on 19/04/16 [start]
connDriver = new ConnDriver();
tempConn = connDriver.getConnectDB("DriverITM"); //Changed by wasim on 05-04-2017 for using same connection so commented [START]
connDriver = null; //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, 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 Manish on 19/04/16 [end]
//Changed by Dharnaj on 19-SEP-14 for [W14FSUN003] //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 = ? ,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 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 = 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(1, totalGrossWeight);
pstmtHdr.setDouble(2, totalTareWeight); pstmtHdr.setDouble(2, totalTareWeight);
pstmtHdr.setDouble(3, totalNetWeight); pstmtHdr.setDouble(3, totalNetWeight);
...@@ -1137,18 +1152,20 @@ public class ConsolidatToDoc { ...@@ -1137,18 +1152,20 @@ public class ConsolidatToDoc {
pstmtHdr.setString(5, despId); pstmtHdr.setString(5, despId);
int upctr = pstmtHdr.executeUpdate(); int upctr = pstmtHdr.executeUpdate();
System.out.println("NO OF ROW UPDATED = "+upctr); 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(); tempConn.commit();
} }
else else
{ {
tempConn.rollback(); tempConn.rollback();
} }*/
//tempConn.close();
//tempConn = null;
//Changed by wasim on 05-04-2017 for using same connection [END]
pstmtHdr.close(); pstmtHdr.close();
pstmtHdr = null; pstmtHdr = null;
tempConn.close();
tempConn = null;
System.out.println("***************START***********************"); System.out.println("***************START***********************");
//Changed by Rohan on 10-06-12 to get reports for hazardous material.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