Commit 18cfddbd authored by jshaikh's avatar jshaikh

Dirty connection related changes in empcomplete component

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@199111 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9bb019fe
......@@ -354,6 +354,18 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
}
else
{
//Added by Jaffar on 03-04-19 for closing result set and statement
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
paySite = genericUtility.getColumnValue("pay_site", dom);
if(paySite != null && paySite.trim().length() > 0 )
{
......@@ -372,13 +384,35 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
errFields.add(childNodeName.toLowerCase());
}
}
//Added by Jaffar on 03-04-19 for closing result set and statement
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
//Changed by Jaffar on 03-04-19 for closing result set and statement
/*rs.close();
rs = null;
pstmt.close();
pstmt = null;*/
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
}
......@@ -649,6 +683,17 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
errFields.add(childNodeName.toLowerCase());
}
}
//Added by Jaffar on 03-04-19 for closing result set and statement
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
}
......@@ -753,6 +798,17 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
errFields.add(childNodeName.toLowerCase());
}
}
//Added by Jaffar on 03-04-19 for closing result set and statement
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
if(childNodeName.equalsIgnoreCase("work_shift"))
......@@ -779,6 +835,17 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
}
else
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = " select count(*) from workshft where site_code = '"+workSite+"' and "
+" shift = '"+workShift+"' and status = 'I' ";
System.out.println(" sql ..............."+sql);
......@@ -794,9 +861,29 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
errFields.add(childNodeName.toLowerCase());
}
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
}
if(childNodeName.equalsIgnoreCase("gratuity_date"))
{
......@@ -956,20 +1043,38 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
e.printStackTrace();
errString=e.getMessage();
}
//Modified by Jaffar on 03-04-19 for closing result set and statement
finally
{
try
{
if(conn!=null)
if (rs != null)
{
conn.close();
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (conn != null)
{
conn.close();
conn = null;
}
catch(Exception d)
}
catch (Exception e)
{
d.printStackTrace();
System.err.println("Exception :" + e.getMessage());
e.printStackTrace();
try {
throw new ITMException(e);
} catch (ITMException e1) {
e1.printStackTrace();
}
}
System.out.println(" EmpComplete Validation End and Connection is Closed");
}
errString = errStringXml.toString();
......@@ -1103,8 +1208,18 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
{
name = rs.getString("name");
}
/*rs.close();
pstmt.close();*/
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("name............................"+name);
empCode = genericUtility.getColumnValue("emp_code", dom);
if(empCode == null)
......@@ -1441,8 +1556,18 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
{
descr = rs.getString("descr");
}
/*rs.close();
pstmt.close();*/
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("descr--------------"+descr);
valueXmlString.append("<class_descr>").append("<![CDATA[" + descr + "]]>").append("</class_descr>");
}
......@@ -1459,8 +1584,18 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
{
descr = rs.getString("descr");
}
/*rs.close();
pstmt.close();*/
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("descr--------------"+descr);
valueXmlString.append("<occ_descr>").append("<![CDATA[" + descr + "]]>").append("</occ_descr>");
}
......@@ -1713,15 +1848,32 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
{
try
{
if(conn != null)
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (conn != null)
{
conn.close();
conn = null;
}
catch(Exception e1)
}
catch (Exception e)
{
System.err.println("Exception :" + e.getMessage());
e.printStackTrace();
try {
throw new ITMException(e);
} catch (ITMException e1) {
e1.printStackTrace();
}
}
}
System.out.println("[EmpComplete] Connection is Closed");
System.out.println("valueXmlString:::::" + valueXmlString.toString());
......@@ -1767,14 +1919,53 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
{
value = " ";
}
/*rs.close();
pstmt.close();*/
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception exception)
{
exception.printStackTrace();
System.out.println("Exception ::" + exception.getMessage());
}
//Added by Jaffar S. on 03-04-19
finally
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (Exception e)
{
System.err.println("Exception :" + e.getMessage());
e.printStackTrace();
try {
throw new ITMException(e);
} catch (ITMException e1) {
e1.printStackTrace();
}
}
}
return value;
}
......@@ -1794,8 +1985,18 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
{
cnt = rs.getInt("count");
}
/*rs.close();
pstmt.close();*/
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("cnt--------------"+cnt);
}
catch(Exception exception)
......@@ -1803,6 +2004,26 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
exception.printStackTrace();
System.out.println("Exception ::" + exception.getMessage());
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
return cnt;
}
private java.util.Date getRelativeDate(java.util.Date date, int n )
......@@ -1842,8 +2063,18 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
{
retValue = "NULLFOUND";
}
/*rs.close();
pstmt.close();*/
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch (SQLException se)
{
......@@ -1872,6 +2103,16 @@ public class EmpComplete extends ValidatorEJB implements EmpCompleteLocal,EmpCo
{
msgType = rs.getString("MSG_TYPE");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
catch(Exception ex)
{
......
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