Commit ee8ca8dc authored by msingh's avatar msingh

Changed by Manish on 17/03/16 for DDUK FOR MAXIMUM CURSOR ISSUE.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@39190 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c84bdea8
...@@ -528,6 +528,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -528,6 +528,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc updated updCnt [" + updCnt + "]"); System.out.println("Changed By 02/05/13 Pragyan sordalloc updated updCnt [" + updCnt + "]");
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
pstmtSord = conn.prepareStatement(sSQL); pstmtSord = conn.prepareStatement(sSQL);
pstmtSord.setString(1, saleOrder); pstmtSord.setString(1, saleOrder);
...@@ -552,7 +559,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -552,7 +559,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
{ {
count = rsSord.getInt(1); count = rsSord.getInt(1);
} }
//Changed by wasim on 14-03-2016 to close prepared/Result set statement [START]
if(pstmtSord != null)
{
pstmtSord.close();pstmtSord = null;
}
if(rsSord != null)
{
rsSord.close();rsSord = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement/Result Set [END]
if(count > 0) if(count > 0)
{ {
...@@ -588,6 +604,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -588,6 +604,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc If alrady exist Location Update Inside grater updCnt2nd [" + updCnt + "]"); System.out.println("Changed By 02/05/13 Pragyan sordalloc If alrady exist Location Update Inside grater updCnt2nd [" + updCnt + "]");
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
} }
else else
{ {
...@@ -644,7 +667,15 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -644,7 +667,15 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
//changed by sankara on 15/10/13 for update of wave_flag //changed by sankara on 15/10/13 for update of wave_flag
pstmtUpd.setString( 25, "Y"); pstmtUpd.setString( 25, "Y");
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc inserted updCnt [" + updCnt + "]"); System.out.println("Changed By 02/05/13 Pragyan sordalloc inserted updCnt [" + updCnt + "]");
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
} }
} }
else else
...@@ -672,6 +703,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -672,6 +703,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
{ {
count = rsSord.getInt(1); count = rsSord.getInt(1);
} }
//Changed by wasim on 14-03-2016 to close prepared/Result set statement [START]
if(pstmtSord != null)
{
pstmtSord.close();pstmtSord = null;
}
if(rsSord != null)
{
rsSord.close();rsSord = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement/Result Set [END]
if(count > 0) if(count > 0)
...@@ -695,7 +736,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -695,7 +736,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setString(7, lotNo); pstmtUpd.setString(7, lotNo);
pstmtUpd.setString(8, lotSl); pstmtUpd.setString(8, lotSl);
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan If alrady exist Location Update updCnt1st [" + updCnt + "]"); System.out.println("Changed By 02/05/13 Pragyan If alrady exist Location Update updCnt1st [" + updCnt + "]");
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
//changed by sankara on 17/10/13 update wave_flag //changed by sankara on 17/10/13 update wave_flag
//updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? ,QUANTITY__STDUOM = QUANTITY__STDUOM + ?" //updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? ,QUANTITY__STDUOM = QUANTITY__STDUOM + ?"
updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? ,QUANTITY__STDUOM = QUANTITY__STDUOM + ?, WAVE_FLAG = 'Y' " updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? ,QUANTITY__STDUOM = QUANTITY__STDUOM + ?, WAVE_FLAG = 'Y' "
...@@ -725,6 +775,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -725,6 +775,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("Changed By 02/05/13 Pragyan sordalloc If alrady exist Location Update updCnt2nd [" + updCnt + "]"); System.out.println("Changed By 02/05/13 Pragyan sordalloc If alrady exist Location Update updCnt2nd [" + updCnt + "]");
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
} }
else else
{ {
...@@ -747,11 +804,17 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -747,11 +804,17 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setString(7, lotSl); pstmtUpd.setString(7, lotSl);
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
} }
} }
//Changed By 02/05/13 Pragyan To check the sordalloc allocated quantity > quantity then insert new record deducte quantity from old location.end //Changed By 02/05/13 Pragyan To check the sordalloc allocated quantity > quantity then insert new record deducte quantity from old location.end
updateSql = "UPDATE PICK_ISS_DET SET LOC_CODE__TO = ? " updateSql = "UPDATE PICK_ISS_DET SET LOC_CODE__TO = ? "
+ " WHERE TRAN_ID = ? AND LINE_NO = ? "; + " WHERE TRAN_ID = ? AND LINE_NO = ? ";
...@@ -762,10 +825,24 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -762,10 +825,24 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setInt(3, lineNo); pstmtUpd.setInt(3, lineNo);
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
} }
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
if (retString != null && retString.trim().length() > 0 ) if (retString != null && retString.trim().length() > 0 )
{ {
isError = true; isError = true;
...@@ -779,8 +856,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -779,8 +856,13 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtUpd.setString(1, pickisstranId); pstmtUpd.setString(1, pickisstranId);
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
//Changed by Sankara on 03/oct/13 adding validation to prevent doc transfer in case of pending/aborted picking.start //Changed by Sankara on 03/oct/13 adding validation to prevent doc transfer in case of pending/aborted picking.start
int countConf = 0; int countConf = 0;
...@@ -797,10 +879,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -797,10 +879,16 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
countConf = rs.getInt(1); countConf = rs.getInt(1);
System.out.println(" Pending Transfer Count["+countConf); System.out.println(" Pending Transfer Count["+countConf);
} }
if(rs != null)
{
rs.close(); rs.close();
rs = null; rs = null;
}
if(pstmt != null)
{
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}
if( countConf > 0) if( countConf > 0)
{ {
...@@ -972,6 +1060,14 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock ...@@ -972,6 +1060,14 @@ public class DockTranConf extends ValidatorEJB implements DockTranConfLocal,Dock
pstmtSord = null; pstmtSord = null;
} }
//Changed by wasim on 14-03-2016 to close prepared statement [START]
if(pstmtUpd != null)
{
pstmtUpd.close();
pstmtUpd = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement [END]
//Changed By 02/05/13 Pragyan Close The Connections.end //Changed By 02/05/13 Pragyan Close The Connections.end
} }
catch(Exception e) catch(Exception e)
......
...@@ -353,6 +353,19 @@ public class PickIssIC extends ValidatorEJB implements PickIssICLocal, PickIssIC ...@@ -353,6 +353,19 @@ public class PickIssIC extends ValidatorEJB implements PickIssICLocal, PickIssIC
errFields.add( childNodeName.toLowerCase() ); errFields.add( childNodeName.toLowerCase() );
} }
} }
//Changed by wasim on 14-03-2016 to close prepared statement/Result Set [START]
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
//Changed by wasim on 14-03-2016 to close prepared statement/ Result set [END]
} }
//Changed by sumit on 28/09/12 validating in case of wave canceled end. //Changed by sumit on 28/09/12 validating in case of wave canceled end.
// cpatil end // cpatil end
......
...@@ -487,6 +487,89 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo ...@@ -487,6 +487,89 @@ public class StockTransferIC extends ValidatorEJB implements StockTransferICRemo
} }
//changed by sankara on 13-02-14 shholud not allow stock transfer if repl is pending end. //changed by sankara on 13-02-14 shholud not allow stock transfer if repl is pending end.
} }
//Changed by wasim on 17-03-2016 to validate no more quantity validation [START]
else if ("item_code".equalsIgnoreCase( childNodeName ) && "DDUK".equalsIgnoreCase(projectName) )
{
itemCode = genericUtility.getColumnValue("item_code", currDom );
locCode = genericUtility.getColumnValue("loc_code", currDom );
siteCode = genericUtility.getColumnValue("site_code", allDom, "1" );
System.out.println("Item Code["+itemCode+"] Location ["+locCode+"] Site Code ["+siteCode+"]");
if ( childNode.getFirstChild() == null )
{
errList.add( "VTITMNL" );
errFields.add( childNodeName.toLowerCase() );
}
else
{
sql = " SELECT COUNT(*) AS COUNT " +
" FROM STOCK STOCK, ITEM ITEM, LOCATION LOCATION " +
" WHERE STOCK.ITEM_CODE = ITEM.ITEM_CODE AND STOCK.LOC_CODE = LOCATION.LOC_CODE "+
" AND STOCK.ITEM_CODE = ? AND STOCK.LOC_CODE = ? AND STOCK.SITE_CODE = ?";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, itemCode );
pstmt.setString( 2, locCode );
pstmt.setString( 3, siteCode );
rs = pstmt.executeQuery();
if( rs.next() )
{
count = rs.getInt("COUNT");
}
if(rs!=null)
{
rs.close();rs = null;
}
if(pstmt!=null)
{
pstmt.close();pstmt = null;
}
System.out.println("Total Item code in this location code is"+count);
if( count == 0 )
{
errList.add( "VTINVVITM" );
errFields.add( childNodeName.toLowerCase() );
}
if(count > 0)
{
count = 0;
sql = " SELECT COUNT(*) AS COUNT " +
" FROM STOCK STOCK, ITEM ITEM, LOCATION LOCATION " +
" WHERE STOCK.ITEM_CODE = ITEM.ITEM_CODE AND STOCK.LOC_CODE = LOCATION.LOC_CODE "+
" AND ((CASE WHEN STOCK.QUANTITY IS NULL THEN 0 ELSE STOCK.QUANTITY END) - ((CASE WHEN STOCK.ALLOC_QTY IS NULL THEN 0 ELSE STOCK.ALLOC_QTY END) + (CASE WHEN STOCK.HOLD_QTY IS NULL THEN 0 ELSE STOCK.HOLD_QTY END))) > 0 "+
" AND STOCK.ITEM_CODE = ? AND STOCK.LOC_CODE = ? AND STOCK.SITE_CODE = ?";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, itemCode );
pstmt.setString( 2, locCode );
pstmt.setString( 3, siteCode );
rs = pstmt.executeQuery();
if( rs.next() )
{
count = rs.getInt("COUNT");
}
if(rs!=null)
{
rs.close();rs = null;
}
if(pstmt!=null)
{
pstmt.close();pstmt = null;
}
System.out.println("Total count for (Quantity - (alloc_qty + hold_qty) > 0)="+count);
if( count == 0 )
{
errList.add( "VTQTYNT" );
errFields.add( childNodeName.toLowerCase() );
}
}
}
}
//Changed by wasim on 17-03-2016 to validate no more quantity validation [END]
}// for loop end }// for loop end
}//case 2 end }//case 2 end
break; break;
......
...@@ -16314,6 +16314,26 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16314,6 +16314,26 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData.addBatch(); pstmtInsertData.addBatch();
pstmtInsertData.executeBatch(); pstmtInsertData.executeBatch();
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
sSQL = "UPDATE DESPATCH SET FREIGHT_AMT_ADD = ? WHERE PTCN = ?";
pstmtDesp = conn.prepareStatement(sSQL);
sql = "UPDATE CARTON_MASTER SET TRACKING_NO = ? , SHIP_LABEL= ? , MSN_NO =?,CARRIER_SYMBOL = ? , CARRIER_FRIENDLYNAME = ?"
+ " WHERE CARTON_NO = ?";
pstmtCart = conn.prepareStatement(sql);
sqlInsertDt = "SELECT CARTON_NO,PICK_ORDER,LINE_NO__PICK,CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE,TRACKING_NO,SHIP_LABEL FROM CARTON_MASTER WHERE PTCN = ? ORDER BY ITEM_CODE";
sqlInsertData1 = "INSERT INTO WAVE_STATUS_ORG_DET (TRAN_ID, LINE_NO,PTCN,CARTON_NO," +
" PICK_ORDER, LINE_NO__PICK ,REF_SER, REF_ID, " +
" CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE, " +
"WEIGHT,TRACKING_NO, SHIP_LABEL )"+
" VALUES (?,?, ?,?, ?,?, ?,?, ?,?, ?,? , ?,?, ?)";
pstmtInsertData1 = conn.prepareStatement(sqlInsertData1);
pstmtDt = conn.prepareStatement(sqlInsertDt);
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[end]
//"Y".equalsIgnoreCase(isADSIConnReq) //"Y".equalsIgnoreCase(isADSIConnReq)
if("P".equalsIgnoreCase(waveMode)) if("P".equalsIgnoreCase(waveMode))
{ {
...@@ -16341,12 +16361,20 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16341,12 +16361,20 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
if("B".equalsIgnoreCase(frtTerm)) if("B".equalsIgnoreCase(frtTerm))
{ {
sSQL = "UPDATE DESPATCH SET FREIGHT_AMT_ADD = ? WHERE PTCN = ?"; //Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
pstmtDesp = conn.prepareStatement(sSQL); /*sSQL = "UPDATE DESPATCH SET FREIGHT_AMT_ADD = ? WHERE PTCN = ?";
pstmtDesp = conn.prepareStatement(sSQL);*/
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[end]
pstmtDesp.setDouble(1, totalFrtAmt); pstmtDesp.setDouble(1, totalFrtAmt);
pstmtDesp.setString(2, ptcn); pstmtDesp.setString(2, ptcn);
int pUpd = pstmtDesp.executeUpdate(); int pUpd = pstmtDesp.executeUpdate();
if(pstmtDesp != null)
{
pstmtDesp.close();
pstmtDesp = null;
}
System.out.println("Update in desp update freight Amt upd ["+pUpd+"] For"); System.out.println("Update in desp update freight Amt upd ["+pUpd+"] For");
} }
...@@ -16423,9 +16451,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16423,9 +16451,12 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
createFolder.mkdirs(); createFolder.mkdirs();
} }
sql = "UPDATE CARTON_MASTER SET TRACKING_NO = ? , SHIP_LABEL= ? , MSN_NO =?,CARRIER_SYMBOL = ? , CARRIER_FRIENDLYNAME = ?" //Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
/*sql = "UPDATE CARTON_MASTER SET TRACKING_NO = ? , SHIP_LABEL= ? , MSN_NO =?,CARRIER_SYMBOL = ? , CARRIER_FRIENDLYNAME = ?"
+ " WHERE CARTON_NO = ?"; + " WHERE CARTON_NO = ?";
pstmtCart = conn.prepareStatement(sql); pstmtCart = conn.prepareStatement(sql);*/
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[end]
pstmtCart.setString(1, trackNo); pstmtCart.setString(1, trackNo);
pstmtCart.setString(2, path ); pstmtCart.setString(2, path );
pstmtCart.setDouble(3, msnNo); pstmtCart.setDouble(3, msnNo);
...@@ -16451,6 +16482,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16451,6 +16482,13 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
System.out.println("Write File Complete----"); System.out.println("Write File Complete----");
} }
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
if( pstmtCart != null )
{
pstmtCart.close();
pstmtCart = null;
}
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
if( pstmt != null ) if( pstmt != null )
{ {
...@@ -16493,7 +16531,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16493,7 +16531,9 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData.addBatch(); */ pstmtInsertData.addBatch(); */
sqlInsertDt = "SELECT CARTON_NO,PICK_ORDER,LINE_NO__PICK,CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE,TRACKING_NO,SHIP_LABEL FROM CARTON_MASTER WHERE PTCN = ? ORDER BY ITEM_CODE";
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
/*sqlInsertDt = "SELECT CARTON_NO,PICK_ORDER,LINE_NO__PICK,CARTON_TYPE,PACK_CODE,MASTER_CARTON,ITEM_CODE,TRACKING_NO,SHIP_LABEL FROM CARTON_MASTER WHERE PTCN = ? ORDER BY ITEM_CODE";
sqlInsertData1 = "INSERT INTO WAVE_STATUS_ORG_DET (TRAN_ID, LINE_NO,PTCN,CARTON_NO," + sqlInsertData1 = "INSERT INTO WAVE_STATUS_ORG_DET (TRAN_ID, LINE_NO,PTCN,CARTON_NO," +
" PICK_ORDER, LINE_NO__PICK ,REF_SER, REF_ID, " + " PICK_ORDER, LINE_NO__PICK ,REF_SER, REF_ID, " +
...@@ -16502,7 +16542,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16502,7 +16542,8 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
" VALUES (?,?, ?,?, ?,?, ?,?, ?,?, ?,? , ?,?, ?)"; " VALUES (?,?, ?,?, ?,?, ?,?, ?,?, ?,? , ?,?, ?)";
pstmtInsertData1 = conn.prepareStatement(sqlInsertData1); pstmtInsertData1 = conn.prepareStatement(sqlInsertData1);
pstmtDt = conn.prepareStatement(sqlInsertDt); pstmtDt = conn.prepareStatement(sqlInsertDt);*/
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[end]
pstmtDt.setString(1, ptcn); pstmtDt.setString(1, ptcn);
rsD = pstmtDt.executeQuery(); rsD = pstmtDt.executeQuery();
...@@ -16582,6 +16623,19 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16582,6 +16623,19 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData1.close(); pstmtInsertData1.close();
pstmtInsertData1 = null; pstmtInsertData1 = null;
} }
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[start]
if( rsD != null)
{
rsD.close();
rsD = null;
}
if( pstmtDt != null)
{
pstmtDt.close();
pstmtDt = null;
}
//Changed by Manish on 15/03/16 for max cursor issue for DDUK.[end]
} }
} }
if( pstmtInsertData != null) if( pstmtInsertData != null)
...@@ -16612,6 +16666,22 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo ...@@ -16612,6 +16666,22 @@ public class WaveGenerationPrc extends ProcessEJB implements WaveGenerationPrcLo
pstmtInsertData1.close(); pstmtInsertData1.close();
pstmtInsertData1 = null; pstmtInsertData1 = null;
} }
if( rsD != null)
{
rsD.close();
rsD = null;
}
if( pstmtDt != null)
{
pstmtDt.close();
pstmtDt = null;
}
if( pstmtCart != null )
{
pstmtCart.close();
pstmtCart = null;
}
} }
catch(Exception e) catch(Exception e)
{ {
......
...@@ -209,6 +209,19 @@ public class CommonWmsUtil { ...@@ -209,6 +209,19 @@ public class CommonWmsUtil {
} }
else else
{ {
//Changed by Manish on 15/03/16 [start]
if(rs != null)
{
rs.close();
rs=null;
}
if(pstmt != null)
{
pstmt.close();
pstmt=null;
}
//Changed by Manish on 15/03/16 [end]
System.out.println("Getting stk_opt from item..."); System.out.println("Getting stk_opt from item...");
sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? "; sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -219,8 +232,22 @@ public class CommonWmsUtil { ...@@ -219,8 +232,22 @@ public class CommonWmsUtil {
stkOpt = rs.getString(1) == null ? "" : rs.getString(1).trim(); stkOpt = rs.getString(1) == null ? "" : rs.getString(1).trim();
} }
} }
rs.close();rs = null; /*rs.close();rs = null;
pstmt.close();pstmt = null; pstmt.close();pstmt = null;*/
//Changed by Manish on 15/03/16 [start]
if(rs != null)
{
rs.close();
rs=null;
}
if(pstmt != null)
{
pstmt.close();
pstmt=null;
}
//Changed by Manish on 15/03/16 [end]
/*sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? "; /*sql = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
...@@ -241,6 +268,23 @@ public class CommonWmsUtil { ...@@ -241,6 +268,23 @@ public class CommonWmsUtil {
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
//Changed by Manish on 15/03/16 [start]
finally
{
if(rs != null)
{
rs.close();
rs=null;
}
if(pstmt != null)
{
pstmt.close();
pstmt=null;
}
}
//Changed by Manish on 15/03/16 [start]
return stkOpt; return stkOpt;
} }
...@@ -1464,7 +1508,7 @@ public class CommonWmsUtil { ...@@ -1464,7 +1508,7 @@ public class CommonWmsUtil {
} }
// Changed by Sneha on 03/07/2015 for finparm, Request ID: D15DKAT001 // Changed by Sneha on 03/07/2015 for finparm, Request ID: D15DKAT001
public String getfinparm(String pCode, String varName, Connection conn) public String getfinparm(String pCode, String varName, Connection conn) throws ITMException
{ {
String sql = ""; String sql = "";
String varValue = ""; String varValue = "";
...@@ -1483,11 +1527,18 @@ public class CommonWmsUtil { ...@@ -1483,11 +1527,18 @@ public class CommonWmsUtil {
varValue = rs.getString("var_value"); varValue = rs.getString("var_value");
addValue = rs.getString("addl_value"); addValue = rs.getString("addl_value");
} }
//Changed by wasim on 15-03-2016 to close result set and addValue condition in try block [START]
if(rs!=null)
{
rs.close();
rs = null;
} }
catch (Exception e) { if(pstmt!=null)
// TODO: handle exception {
pstmt.close();
pstmt = null;
} }
if(addValue == null || addValue.trim().length() == 0) if(addValue == null || addValue.trim().length() == 0)
{ {
return varValue; return varValue;
...@@ -1496,6 +1547,34 @@ public class CommonWmsUtil { ...@@ -1496,6 +1547,34 @@ public class CommonWmsUtil {
{ {
return varValue.trim()+";"+addValue.trim(); return varValue.trim()+";"+addValue.trim();
} }
//Changed by wasim on 15-03-2016 to close result set and addValue condition in try block [END]
}
catch (Exception e)
{
throw new ITMException(e);
}
//Changed by wasim on 15-03-2016 to add finally block [START]
finally
{
try
{
if(rs!=null)
{
rs.close();
rs = null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
//Changed by wasim on 15-03-2016 to add finally block [END]
} }
//End by Sneha on 03/07/2015 for finparm, Request ID: D15DKAT001 //End by Sneha on 03/07/2015 for finparm, Request ID: D15DKAT001
......
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