Commit cef25c86 authored by wansari's avatar wansari

Changed by wasim to close result set and prepared statement for DDUK


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100957 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e11a972b
...@@ -540,6 +540,24 @@ public class AutoPmtGenPrc extends ProcessEJB ...@@ -540,6 +540,24 @@ public class AutoPmtGenPrc extends ProcessEJB
{ {
conn.close(); conn.close();
conn = null; conn = null;
//Changed by wasim to close result set/statement [START]
if(rsTemp!=null)
{
rsTemp.close();rsTemp=null;
}
if(pstmt!=null)
{
pstmt.close();pstmt=null;
}
if(pstmt1!=null)
{
pstmt1.close();pstmt1=null;
}
if(rs!=null)
{
rs.close();rs=null;
}
//Changed by wasim to close result set/statement [END]
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -2228,7 +2246,16 @@ Timestamp refDateSTr=null; ...@@ -2228,7 +2246,16 @@ Timestamp refDateSTr=null;
msgType = ""; msgType = "";
msgString = ""; msgString = "";
} }
//Changed by wasim on 17-03-2016 to close statement/Result set [START]
if(stmt!=null)
{
stmt.close();stmt=null;
}
if(rs!=null)
{
rs.close();rs=null;
}
//Changed by wasim on 17-03-2016 to close statement/Result set [END]
if ((msgType.equals("E")) || (msgType.trim().length() == 0)) if ((msgType.equals("E")) || (msgType.trim().length() == 0))
{ {
String sqlQuery1 = "SELECT PROFILE_ID FROM USERS WHERE CODE='" + userId + "'"; String sqlQuery1 = "SELECT PROFILE_ID FROM USERS WHERE CODE='" + userId + "'";
...@@ -2342,6 +2369,34 @@ Timestamp refDateSTr=null; ...@@ -2342,6 +2369,34 @@ Timestamp refDateSTr=null;
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
//Changed by wasim to add finally block [START]
finally
{
try
{
if(stmt!=null)
{
stmt.close();stmt = null;
}
if(rs!=null)
{
rs.close();rs=null;
}
if(rs1!=null)
{
rs1.close();rs1=null;
}
if(rs2!=null)
{
rs2.close();rs2=null;
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
//Changed by wasim to add finally block [END]
FileOutputStream fos; FileOutputStream fos;
return errStringXml.toString(); return errStringXml.toString();
} }
...@@ -2521,6 +2576,26 @@ Timestamp refDateSTr=null; ...@@ -2521,6 +2576,26 @@ Timestamp refDateSTr=null;
System.out.println("Exception ::" + e); System.out.println("Exception ::" + e);
throw new ITMException(e); throw new ITMException(e);
} }
//Changed by wasim to add finally block [START]
finally
{
try
{
if(pstmt!=null)
{
pstmt.close();pstmt=null;
}
if(rs!=null)
{
rs.close();rs=null;
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
//Changed by wasim to add finally block [END]
return stanCode; return stanCode;
} }
...@@ -2652,6 +2727,26 @@ Timestamp refDateSTr=null; ...@@ -2652,6 +2727,26 @@ Timestamp refDateSTr=null;
System.out.println("Exception ::" + e); System.out.println("Exception ::" + e);
throw new ITMException(e); throw new ITMException(e);
} }
//Changed by wasim to add finally block [START]
finally
{
try
{
if(pstmt!=null)
{
pstmt.close();pstmt=null;
}
if(rs!=null)
{
rs.close();rs=null;
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
//Changed by wasim to add finally block [END]
return payables; return payables;
} }
...@@ -2845,6 +2940,26 @@ Timestamp refDateSTr=null; ...@@ -2845,6 +2940,26 @@ Timestamp refDateSTr=null;
System.out.println("Exception ::" + e); System.out.println("Exception ::" + e);
throw new ITMException(e); throw new ITMException(e);
} }
//Changed by wasim to add finally block [START]
finally
{
try
{
if(pstmt!=null)
{
pstmt.close();pstmt=null;
}
if(rs!=null)
{
rs.close();rs=null;
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
//Changed by wasim to add finally block [END]
return dueDate; return dueDate;
} }
......
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