Commit 2eb5afd0 authored by prane's avatar prane

added finally block to close connections

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187723 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 764b435b
......@@ -574,22 +574,36 @@ public class StockAllocVerifyWiz extends ValidatorEJB implements StockAllocVerif
System.out.println("StockAllocVerifyWiz.itemChanged():catchBlock" + e.getMessage());
e.printStackTrace();
throw new ITMException(e);
} finally {
try {
if (rs != null) {
rs.close();
rs = null;
}
if (pstmt != null) {
pstmt.close();
pstmt = null;
}
if (!conn.isClosed() && conn != null) {
} finally{
try
{
if (conn != null)
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
conn.close();
conn = null;
}
} catch (Exception e) {
System.out.println("StockAllocVerifyWiz.itemChanged():finally block");
}
} catch (Exception e)
{
e.printStackTrace();
}
}
......
......@@ -173,6 +173,28 @@ public class StockAllocVerifyWizBean extends ValidatorEJB {
} catch (Exception e) {
e.printStackTrace();
throw new ITMException(e);
}finally{
try
{
if (conn != null)
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
conn = null;
}
} catch (Exception e)
{
e.printStackTrace();
}
}
return retHtmlData;
......@@ -192,7 +214,7 @@ public class StockAllocVerifyWizBean extends ValidatorEJB {
String lotNo = "";
String lotSl = "";
String xmlData = "";
int formNo = 2;
int formNo = 2;
ConnDriver connDriver = null;
int row = 0;
SimpleDateFormat sdf = null;
......@@ -545,6 +567,28 @@ public class StockAllocVerifyWizBean extends ValidatorEJB {
e.printStackTrace();
e.printStackTrace();
throw new ITMException(e);
}finally{
try
{
if (conn != null)
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
conn = null;
}
} catch (Exception e)
{
e.printStackTrace();
}
}
return retHtmlData;
......
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