Commit cb84d856 authored by jshinde's avatar jshinde

add finally block and close the connection


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@102890 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9331f05d
...@@ -1618,7 +1618,7 @@ public class PalletOutPos extends ValidatorEJB implements PalletOutPosLocal, Pal ...@@ -1618,7 +1618,7 @@ public class PalletOutPos extends ValidatorEJB implements PalletOutPosLocal, Pal
System.out.println("Last final return String2 ="+retString); System.out.println("Last final return String2 ="+retString);
return retString; return retString;
} }
private double getIntegralQty(String siteCode, String itemCode, String lotNo, String packCode, String checkIntegralQty) private double getIntegralQty(String siteCode, String itemCode, String lotNo, String packCode, String checkIntegralQty) throws ITMException
{ {
double integralQty = 0.0D; double integralQty = 0.0D;
String sql = ""; String sql = "";
...@@ -1709,12 +1709,35 @@ public class PalletOutPos extends ValidatorEJB implements PalletOutPosLocal, Pal ...@@ -1709,12 +1709,35 @@ public class PalletOutPos extends ValidatorEJB implements PalletOutPosLocal, Pal
integralQty = rs.getDouble(1); integralQty = rs.getDouble(1);
} }
conn.close(); //conn.close();
} }
catch (Exception e) catch (Exception e)
{ {
System.out.println("the exception occurs in getIntegralQty :" + e); System.out.println("the exception occurs in getIntegralQty :" + e);
} }
//Changed by Jagruti Shinde on 04-08-2016 to add finally block and close the connection [Start]
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
//Changed by Jagruti Shinde on 04-08-2016 to add finally block and close the connection [End]
System.out.println("integralQty :" + integralQty); System.out.println("integralQty :" + integralQty);
return integralQty; return integralQty;
} }
...@@ -2111,7 +2134,7 @@ public class PalletOutPos extends ValidatorEJB implements PalletOutPosLocal, Pal ...@@ -2111,7 +2134,7 @@ public class PalletOutPos extends ValidatorEJB implements PalletOutPosLocal, Pal
return retStrInDate; return retStrInDate;
} }
private int getNoArt(String siteCode, String custCode, String itemCode, String packCode, double qty, char type, double shipperQty, double integralQty1) private int getNoArt(String siteCode, String custCode, String itemCode, String packCode, double qty, char type, double shipperQty, double integralQty1) throws ITMException
{ {
String sql = ""; String sql = "";
ResultSet rs = null; ResultSet rs = null;
...@@ -2326,6 +2349,29 @@ public class PalletOutPos extends ValidatorEJB implements PalletOutPosLocal, Pal ...@@ -2326,6 +2349,29 @@ public class PalletOutPos extends ValidatorEJB implements PalletOutPosLocal, Pal
{ {
System.out.println("Exception occures in getNoArt :" + e); System.out.println("Exception occures in getNoArt :" + e);
} }
//Changed by Jagruti Shinde on 04-08-2016 to add finally block and close the connection [Start]
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
//Changed by Jagruti Shinde on 04-08-2016 to add finally block and close the connection [End]
System.out.println("(int)noArt :" + (int)noArt); System.out.println("(int)noArt :" + (int)noArt);
return (int)noArt; return (int)noArt;
} }
......
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