Commit 2bc63b82 authored by ssalve's avatar ssalve

Sarita: Done changes to create method to get long name on 27 SEP 2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@191276 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3b177ffb
......@@ -235,7 +235,8 @@ public class EmpITConfirmationIC extends ValidatorEJB implements EmpITConfirmati
else if("emp_code__fr".equalsIgnoreCase(currentColumn))
{
empcodefr = checkNullAndTrim(genericUtility.getColumnValue("emp_code__fr", dom));
sql = "select emp_fname, emp_lname from employee where emp_code = ?";
//Commented and added by sarita to create method to get longname on 27 SEP 2018 [START]
/* sql = "select emp_fname, emp_lname from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empcodefr);
rs = pstmt.executeQuery();
......@@ -254,13 +255,16 @@ public class EmpITConfirmationIC extends ValidatorEJB implements EmpITConfirmati
pstmt.close();
pstmt = null;
}
empName = empFirstName + " " + empLastName;
empName = empFirstName + " " + empLastName;*/
empName = ddfGetMastersName(empcodefr, conn); System.out.println("emp_name__fr ["+empName+"]");
//Commented and added by sarita to create method to get longname on 27 SEP 2018 [END]
valueXmlString.append("<emp_name__fr>").append("<![CDATA[" + empName + "]]>").append("</emp_name__fr>");
}//end of itemchange for emp_code__fr
else if("emp_code__to".equalsIgnoreCase(currentColumn))
{
empcodeTo = checkNullAndTrim(genericUtility.getColumnValue("emp_code__to", dom));
sql = "select emp_fname, emp_lname from employee where emp_code = ?";
//Commented and added by sarita to create method to get longname on 27 SEP 2018 [START]
/*sql = "select emp_fname, emp_lname from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empcodeTo);
rs = pstmt.executeQuery();
......@@ -279,7 +283,9 @@ public class EmpITConfirmationIC extends ValidatorEJB implements EmpITConfirmati
pstmt.close();
pstmt = null;
}
empName = empFirstName + " " + empLastName;
empName = empFirstName + " " + empLastName;*/
empName = ddfGetMastersName(empcodeTo, conn); System.out.println("emp_name__to ["+empName+"]");
//Commented and added by sarita to create method to get longname on 27 SEP 2018 [END]
valueXmlString.append("<emp_name__to>").append("<![CDATA[" + empName + "]]>").append("</emp_name__to>");
//set Total No. of Employees using emp_code__fr and emp_code__to [START]
......@@ -480,5 +486,44 @@ public class EmpITConfirmationIC extends ValidatorEJB implements EmpITConfirmati
}
return input;
}//end of method checkNullAndTrim
//Added by sarita to create method to get longname on 27 SEP 2018 [START]
public String ddfGetMastersName(String empCode,Connection conn)
{
String longName = "",empFirstName = "", empLastName = "";
String sql = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
sql = "select emp_fname, emp_lname from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
rs = pstmt.executeQuery();
if (rs.next())
{
empFirstName = rs.getString("emp_fname");
empLastName = rs.getString("emp_lname");
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
longName = empFirstName + " " + empLastName;
System.out.println("Long Name of an Employee is ::: ["+longName+"]");
}
catch(Exception e)
{
System.out.println("Exception in EJB[" + getClass().getSimpleName() + "]::itemChanged::[" + e.getMessage() + "]");
}
return longName;
}
//Added by sarita to create method to get longname on 27 SEP 2018 [END]
}
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