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