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