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,
String termId = "";
String chgUser = "";
String chgTerm = "";
String sql = "",insertHed="", insertDetail ="",stockSql="";
PreparedStatement pstmt = null,pstmt1=null;
ResultSet rs = null,rs1 = null;
String sql = "",insertHed="", insertDetail ="",stockSql="",sql2="";
PreparedStatement pstmt = null,pstmt1=null,pstmt2=null;
ResultSet rs = null,rs1 = null,rs2 = null;
GenericUtility genericUtility = null;
Timestamp currDate = null;
String retString = null;
......@@ -540,17 +540,17 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
}
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);
pstmt1.setString(1,worder);
pstmt1.setString(2,itemCode);
rs1 = pstmt1.executeQuery();
while(rs1.next())
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1,worder);
pstmt2.setString(2,itemCode);
rs2 = pstmt2.executeQuery();
while(rs2.next())
{
locCode =rs1.getString(1);
lotNoInv =rs1.getString(2);
lotSlInv =rs1.getString(3);
locCode =rs2.getString(1);
lotNoInv =rs2.getString(2);
lotSlInv =rs2.getString(3);
String propReqQtyStr = df.format(propReqQty);
......@@ -624,8 +624,10 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
System.out.println("Count after PSTM is:- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%["+cnt+"]");
pstmt1.close();pstmt1=null;
}
rs1.close();rs1=null;
pstmt1.close();pstmt1=null;
rs2.close();
rs2=null;
pstmt2.close();
pstmt2=null;
}
}
System.out.println("detail record :: inserted "+updDet);
......@@ -654,6 +656,16 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
rs.close();
rs = null;
}
if(pstmt2 != null)
{
pstmt2.close();
pstmt2 = null;
}
if(rs2 != null)
{
rs2.close();
rs2 = null;
}
}
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