Commit 32a869c0 authored by prane's avatar prane

to close the cursor and pstmt while retuing string

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@197657 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 67ab787a
...@@ -258,6 +258,8 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri ...@@ -258,6 +258,8 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri
} }
chkPlrs.close(); chkPlrs.close();
chkPlrs = null; chkPlrs = null;
chkPlpstmt.close(); //23feb19[pstmt closed and nulled on 12feb19]
chkPlpstmt = null;
System.out.println("@@@@@@ plCount["+plCount+"]"); System.out.println("@@@@@@ plCount["+plCount+"]");
if(plCount > 0) if(plCount > 0)
{/* {/*
...@@ -354,6 +356,8 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri ...@@ -354,6 +356,8 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri
pricelstGenChrgBill = dtlrs.getDouble("vat_chrg_billing"); pricelstGenChrgBill = dtlrs.getDouble("vat_chrg_billing");
pricelstGenMargRet = dtlrs.getDouble("margin_retailer"); pricelstGenMargRet = dtlrs.getDouble("margin_retailer");
} }
dtlrs.close();//23feb19[rs closed and nulled on 12feb19]
dtlrs = null;
dtlpstmt.close(); dtlpstmt.close();
dtlpstmt = null; dtlpstmt = null;
...@@ -377,7 +381,8 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri ...@@ -377,7 +381,8 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri
} }
chkPlrs.close(); chkPlrs.close();
chkPlrs = null; chkPlrs = null;
chkPlpstmt.close();//23feb19[rs closed and nulled on 12feb19]
chkPlpstmt = null;
if(plCount > 0) if(plCount > 0)
{ {
...@@ -444,6 +449,8 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri ...@@ -444,6 +449,8 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri
dateOverpstmt.setInt (5, slabNo ); dateOverpstmt.setInt (5, slabNo );
updtCnt = dateOverpstmt.executeUpdate(); updtCnt = dateOverpstmt.executeUpdate();
dateOverpstmt.close();//23feb19[rs closed and nulled on 12feb19]
dateOverpstmt = null;
} }
int slabNoUpdt = 1; int slabNoUpdt = 1;
...@@ -1458,6 +1465,9 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri ...@@ -1458,6 +1465,9 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri
currentlotnofr=rs.getString(1); currentlotnofr=rs.getString(1);
currentlotnoto=rs.getString(2); currentlotnoto=rs.getString(2);
} }
rs.close(); rs = null;
pstmtSql.close();
pstmtSql = null;//[pstmt and rs closed and nulled on 23feb19]
recordfound = true; recordfound = true;
System.out.println("Recode Found@@@@@@@@@@@@@"+recordfound); System.out.println("Recode Found@@@@@@@@@@@@@"+recordfound);
currentlotnofrtemp = currentlotnofr; currentlotnofrtemp = currentlotnofr;
...@@ -1857,7 +1867,27 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri ...@@ -1857,7 +1867,27 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri
System.out.println("Exception : "+e); System.out.println("Exception : "+e);
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }finally {
try {
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmtSql != null)
{
pstmtSql.close();
pstmtSql = null;
}
if(pstmtInsert != null)
{
pstmtInsert.close();
pstmtInsert = null;
}
}catch(Excewption e)
{
}
}
return retString; return retString;
} }
...@@ -1880,4 +1910,4 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri ...@@ -1880,4 +1910,4 @@ public class PriceListPos extends ValidatorEJB implements PriceListPosLocal, Pri
} }
} }
\ No newline at end of file
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