Commit 1c85be61 authored by skale's avatar skale

As changes by Alam for closing cursor.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91198 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9e9b710b
...@@ -144,22 +144,32 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis ...@@ -144,22 +144,32 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis
sqlItem = "SELECT STK_OPT FROM SITEITEM WHERE ITEM_CODE = '"+itemCode+"' " sqlItem = "SELECT STK_OPT FROM SITEITEM WHERE ITEM_CODE = '"+itemCode+"' "
+"AND SITE_CODE = '"+siteCode+"'"; +"AND SITE_CODE = '"+siteCode+"'";
System.out.println("The select sql sqlItem:"+sqlItem); System.out.println("The select sql sqlItem:"+sqlItem);
rs1 = stmt1.executeQuery(sqlItem); pstmt = conn.prepareStatement( sqlItem );
rs1 = pstmt.executeQuery();
if (rs1.next()) if (rs1.next())
{ {
stockOpt = rs1.getString(1); stockOpt = rs1.getString(1);
System.out.println("stockOpt :"+stockOpt); System.out.println("stockOpt :"+stockOpt);
} }
rs1.close();
rs1 = null;
pstmt.close();
pstmt = null;
if (stockOpt == null) if (stockOpt == null)
{ {
sqlItem = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE ='"+itemCode+"'"; sqlItem = "SELECT STK_OPT FROM ITEM WHERE ITEM_CODE ='"+itemCode+"'";
System.out.println("The select sqlItem :"+sqlItem); System.out.println("The select sqlItem :"+sqlItem);
rs2 = stmt1.executeQuery(sqlItem); pstmt = conn.prepareStatement( sqlItem );
rs2 = pstmt.executeQuery();
if (rs2.next()) if (rs2.next())
{ {
stockOpt = rs2.getString(1); stockOpt = rs2.getString(1);
System.out.println("stockOpt :"+stockOpt); System.out.println("stockOpt :"+stockOpt);
} }
rs2.close();
rs2 = null;
pstmt.close();
pstmt = null;
} }
if (!stockOpt.equalsIgnoreCase("0")) if (!stockOpt.equalsIgnoreCase("0"))
{ {
...@@ -215,6 +225,16 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis ...@@ -215,6 +225,16 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis
{ {
try try
{ {
if( rs1 != null )
{
rs1.close();
rs1 = null;
}
if( rs2 != null )
{
rs2.close();
rs2 = null;
}
if(stmt != null) if(stmt != null)
{ {
stmt.close(); stmt.close();
...@@ -225,6 +245,11 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis ...@@ -225,6 +245,11 @@ public class DistIssuePos extends ValidatorEJB implements DistIssuePosLocal, Dis
stmt1.close(); stmt1.close();
stmt1 = null; stmt1 = null;
} }
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
} }
catch(Exception e) catch(Exception e)
{ {
......
...@@ -144,6 +144,11 @@ public class InvAllocTraceBean ...@@ -144,6 +144,11 @@ public class InvAllocTraceBean
pstmt.setString(14,chgTerm); pstmt.setString(14,chgTerm);
pstmt.setDate(15,chgDate); pstmt.setDate(15,chgDate);
pstmt.executeUpdate(); pstmt.executeUpdate();
//added by msalam on 281209 start
pstmt.close();
pstmt = null;
//added by msalam on 281209 end
System.out.println("insertion of sql inside updateInvallocTrace success on date "+ chgDate); System.out.println("insertion of sql inside updateInvallocTrace success on date "+ chgDate);
System.out.println("Allocate trace Updated..............................."); System.out.println("Allocate trace Updated...............................");
...@@ -162,6 +167,11 @@ public class InvAllocTraceBean ...@@ -162,6 +167,11 @@ public class InvAllocTraceBean
// { // {
System.out.println("sqlUpdate "+ sqlUpdate); System.out.println("sqlUpdate "+ sqlUpdate);
int i = pstmt.executeUpdate() ; int i = pstmt.executeUpdate() ;
//added by msalam on 281209 start
pstmt.close();
pstmt = null;
//added by msalam on 281209 end
System.out.println("Records updated "+ i); System.out.println("Records updated "+ i);
if(i>0) if(i>0)
{ {
......
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