Commit 5b6de362 authored by cpatil's avatar cpatil

remove null pointer error


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96751 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0784e6df
...@@ -327,9 +327,9 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -327,9 +327,9 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
String termId = ""; String termId = "";
String chgUser = ""; String chgUser = "";
String chgTerm = ""; String chgTerm = "";
String sql = "",insertHed="", insertDetail ="",stockSql=""; String sql = "",insertHed="", insertDetail ="",stockSql="",sql2="";
PreparedStatement pstmt = null,pstmt1=null; PreparedStatement pstmt = null,pstmt1=null,pstmt2=null;
ResultSet rs = null,rs1 = null; ResultSet rs = null,rs1 = null,rs2 = null;
GenericUtility genericUtility = null; GenericUtility genericUtility = null;
Timestamp currDate = null; Timestamp currDate = null;
String retString = null; String retString = null;
...@@ -540,17 +540,17 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -540,17 +540,17 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
} }
if(flag == false) if(flag == false)
{ {
sql = " SELECT LOC_CODE,LOT_NO,LOT_SL FROM INV_ALLOC_DET WHERE TRAN_ID IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER = ? ) AND ITEM_CODE = ? "; sql2 = " SELECT LOC_CODE,LOT_NO,LOT_SL FROM INV_ALLOC_DET WHERE TRAN_ID IN (SELECT TRAN_ID FROM INV_ALLOCATE WHERE WORK_ORDER = ? ) AND ITEM_CODE = ? ";
pstmt1 = conn.prepareStatement(sql); pstmt2 = conn.prepareStatement(sql2);
pstmt1.setString(1,worder); pstmt2.setString(1,worder);
pstmt1.setString(2,itemCode); pstmt2.setString(2,itemCode);
rs1 = pstmt1.executeQuery(); rs2 = pstmt2.executeQuery();
while(rs1.next()) while(rs2.next())
{ {
locCode =rs1.getString(1); locCode =rs2.getString(1);
lotNoInv =rs1.getString(2); lotNoInv =rs2.getString(2);
lotSlInv =rs1.getString(3); lotSlInv =rs2.getString(3);
String propReqQtyStr = df.format(propReqQty); String propReqQtyStr = df.format(propReqQty);
...@@ -624,8 +624,10 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -624,8 +624,10 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
System.out.println("Count after PSTM is:- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%["+cnt+"]"); System.out.println("Count after PSTM is:- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%["+cnt+"]");
pstmt1.close();pstmt1=null; pstmt1.close();pstmt1=null;
} }
rs1.close();rs1=null; rs2.close();
pstmt1.close();pstmt1=null; rs2=null;
pstmt2.close();
pstmt2=null;
} }
} }
System.out.println("detail record :: inserted "+updDet); System.out.println("detail record :: inserted "+updDet);
...@@ -654,6 +656,16 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal, ...@@ -654,6 +656,16 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
rs.close(); rs.close();
rs = null; rs = null;
} }
if(pstmt2 != null)
{
pstmt2.close();
pstmt2 = null;
}
if(rs2 != null)
{
rs2.close();
rs2 = null;
}
} }
catch(Exception e) catch(Exception e)
{ {
......
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