Commit 91a4d4f0 authored by sghate's avatar sghate

Done Migration related changes in EmpMaritalStatusIC Component

EmpMaritalStatusConfPrc.java
EmpMaritalStatusIC.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@214556 ce508802-f39f-4f6c-b175-0d175dae99d5
parent acbbd617
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
package ibase.webitm.ejb.adm; package ibase.webitm.ejb.adm;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.system.config.ConnDriver; //modified by Shital on 09/08/2019 [Start]
//import ibase.system.config.ConnDriver;
//modified by Shital on 09/08/2019 [End]
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB; import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ITMDBAccessLocal; import ibase.webitm.ejb.ITMDBAccessLocal;
...@@ -18,8 +20,9 @@ import java.sql.Connection; ...@@ -18,8 +20,9 @@ import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Timestamp; import java.sql.Timestamp;
//modified by Shital on 09/08/2019 [Start]
import javax.ejb.Stateless; //import javax.ejb.Stateless;
//modified by Shital on 09/08/2019 [End]
import javax.naming.InitialContext; import javax.naming.InitialContext;
import org.w3c.dom.Document; import org.w3c.dom.Document;
...@@ -27,10 +30,14 @@ import org.w3c.dom.Document; ...@@ -27,10 +30,14 @@ import org.w3c.dom.Document;
/** /**
* Session Bean implementation class EmpMaritalStatusConfPrc * Session Bean implementation class EmpMaritalStatusConfPrc
*/ */
@Stateless //modified by Shital on 09/08/2019 [Start]
//@Stateless
//modified by Shital on 09/08/2019 [End]
public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalStatusConfPrcRemote, EmpMaritalStatusConfPrcLocal public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalStatusConfPrcRemote, EmpMaritalStatusConfPrcLocal
{ {
E12GenericUtility genericUtility=new E12GenericUtility(); E12GenericUtility genericUtility=new E12GenericUtility();
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
public String process() throws RemoteException,ITMException public String process() throws RemoteException,ITMException
{ {
return ""; return "";
...@@ -67,40 +74,44 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta ...@@ -67,40 +74,44 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta
public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException, ITMException public String process(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException, ITMException
{ {
String returnString = "",confirm="",empCode="",tranDate="",sql=""; String returnString = "";
Timestamp tranDateTimestamp=null; String confirm = "";
String empCode = "";
String tranDate = "";
String sql = "";
Timestamp tranDateTimestamp = null;
boolean isError = false; boolean isError = false;
Connection connection = null; Connection conn = null;
ConnDriver connDriver = null; //modified by Shital on 09/08/2019 [Start]
//ConnDriver connDriver = null;
//modified by Shital on 09/08/2019 [End]
AppConnectParm appConnect = null; AppConnectParm appConnect = null;
InitialContext initialCtx = null; InitialContext initialCtx = null;
EmpMaritalStatusConfLocal empMaritalStatusConf = null; EmpMaritalStatusConfLocal empMaritalStatusConf = null;
//Commented and added by Varsha V on 20-Jul-18 for removing lookup ITMDBAccessLocal itmDBAccess = null;
//ITMDBAccessLocal itmDBAccess = null;
ITMDBAccessEJB itmDBAccess = null;
PreparedStatement pstmt=null; PreparedStatement pstmt=null;
ResultSet rs=null; ResultSet rs=null;
try try
{ {
connDriver = new ConnDriver(); //modified by Shital on 09/08/2019 [Start]
connection = connDriver.getConnectDB("DriverITM"); //connDriver = new ConnDriver();
connection.setAutoCommit(false); //connection = connDriver.getConnectDB("DriverITM");
//Commented and added by Varsha V on 20-Jul-18 for removing lookup conn = getConnection();
//appConnect = new AppConnectParm(); //modified by Shital on 09/08/2019 [End]
//initialCtx = new InitialContext(appConnect.getProperty()); conn.setAutoCommit(false);
//itmDBAccess = (ITMDBAccessLocal)initialCtx.lookup("ibase/ITMDBAccessEJB/local"); appConnect = new AppConnectParm();
itmDBAccess = new ITMDBAccessEJB(); initialCtx = new InitialContext(appConnect.getProperty());
itmDBAccess = (ITMDBAccessLocal)initialCtx.lookup("ibase/ITMDBAccessEJB/local");
empCode = checkNull(genericUtility.getColumnValue("emp_code", headerDom)); empCode = checkNull(genericUtility.getColumnValue("emp_code", headerDom));
tranDate = checkNull(genericUtility.getColumnValue("tran_date", headerDom)); tranDate = checkNull(genericUtility.getColumnValue("tran_date", headerDom));
System.out.println("@V@ VALLABH empCode :- ["+empCode+"]"); System.out.println("@V@ VALLABH empCode :- ["+empCode+"]");
System.out.println("@V@ VALLABH tranDate :- ["+tranDate+"]"); System.out.println("@V@ VALLABH tranDate :- ["+tranDate+"]");
tranDateTimestamp = Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate, genericUtility.getApplDateFormat() tranDateTimestamp = Timestamp.valueOf(genericUtility.getValidDateTimeString(tranDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()));
,genericUtility.getDBDateFormat()));
sql = "SELECT CONFIRM FROM EMP_MARITALCHG WHERE EMP_CODE = ? AND TRAN_DATE = ? ";
sql = "SELECT CONFIRM FROM EMP_MARITALCHG WHERE EMP_CODE = ? AND TRAN_DATE = ?"; pstmt = conn.prepareStatement(sql);
pstmt = connection.prepareStatement(sql);
pstmt.setString(1, empCode); pstmt.setString(1, empCode);
pstmt.setTimestamp(2, tranDateTimestamp); pstmt.setTimestamp(2, tranDateTimestamp);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -108,20 +119,36 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta ...@@ -108,20 +119,36 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta
{ {
confirm = checkNull(rs.getString("CONFIRM")); confirm = checkNull(rs.getString("CONFIRM"));
} }
pstmt.close(); //Changed By sanket on 08/MAR/18 [for proper closing connection]
pstmt=null; //modified by Shital on 09/08/2019 [Start]
rs.close(); //rs.close();
rs=null; //rs = null;
//pstmt.close();
//pstmt = null;
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//modified by Shital on 09/08/2019 [End]
System.out.println("@V@ VALLABH confirm :- ["+confirm+"]"); System.out.println("@V@ VALLABH confirm :- ["+confirm+"]");
if(!"X".equalsIgnoreCase(confirm)) if(!"X".equalsIgnoreCase(confirm))
{ {
empMaritalStatusConf = (EmpMaritalStatusConfLocal)initialCtx.lookup("ibase/EmpMaritalStatusConf/local"); empMaritalStatusConf = (EmpMaritalStatusConfLocal)initialCtx.lookup("ibase/EmpMaritalStatusConf/local");
returnString = checkNull(empMaritalStatusConf.actionHandler("", headerDom, detailDom, xtraParams, "N", connection)); returnString = checkNull(empMaritalStatusConf.actionHandler("", headerDom, detailDom, xtraParams, "N", conn));
System.out.println("EmpMaritalStatusConfPrc returnString ::[" + returnString + "]"); System.out.println("EmpMaritalStatusConfPrc returnString ::[" + returnString + "]");
} }
else else
{ {
returnString = itmDBAccess.getErrorString("", "VTALRDCACL", "", "", connection); //modified by Shital on 09/08/2019 [Start]
//returnString = itmDBAccess.getErrorString("", "VTALRDCACL", "", "", conn);
returnString = itmDBAccessEJB.getErrorString("", "VTALRDCACL", "", "", conn);
//modified by Shital on 09/08/2019 [End]
return returnString; return returnString;
} }
if(returnString.length() > 0) if(returnString.length() > 0)
...@@ -131,9 +158,11 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta ...@@ -131,9 +158,11 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta
} }
else else
{ {
returnString = itmDBAccess.getErrorString("", "VTMARSCH03", "", "", connection); //modified by Shital on 09/08/2019 [Start]
//returnString = itmDBAccess.getErrorString("", "VTMARSCH03", "", "", conn);
returnString = itmDBAccessEJB.getErrorString("", "VTMARSCH03", "", "", conn);
//modified by Shital on 09/08/2019 [End]
} }
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -149,24 +178,39 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta ...@@ -149,24 +178,39 @@ public class EmpMaritalStatusConfPrc extends ProcessEJB implements EmpMaritalSta
{ {
if(isError) if(isError)
{ {
connection.rollback(); conn.rollback();
System.out.println("EmpMaritalStatusConfPrc connection rollback"); System.out.println("EmpMaritalStatusConfPrc connection rollback");
} }
else else
{ {
connection.commit(); conn.commit();
System.out.println("EmpMaritalStatusConfPrc connection committed"); System.out.println("EmpMaritalStatusConfPrc connection committed");
} }
if(connection != null) //modified by Shital on 09/08/2019 [Start]
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//modified by Shital on 09/08/2019 [End]
if(conn != null)
{ {
connection.close(); conn.close();
connection = null; conn = null;
} }
} }
catch(Exception e) catch(Exception e)
{ {
returnString = e.getMessage(); returnString = e.getMessage();
e.printStackTrace(); e.printStackTrace();
//modified by Shital on 09/08/2019 [Start]
throw new ITMException(e);
//modified by Shital on 09/08/2019 [End]
} }
} }
System.out.println("errString...:: "+returnString); System.out.println("errString...:: "+returnString);
......
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