Commit 5860b986 authored by ssalve's avatar ssalve

Sarita : Done changes to 1. remove Lookup for ITMDBAccessEJB and created...

Sarita : Done changes to 1. remove Lookup for ITMDBAccessEJB and created object and  2. use connection method of ITMDBAccessEJB for calling getErrorString 

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187965 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2bfa9157
......@@ -5,15 +5,15 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.ejb.Stateless;
import javax.naming.InitialContext;
import ibase.system.config.AppConnectParm;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessLocal;
//Added and commented by sarita on 20JULY18
import ibase.webitm.ejb.ITMDBAccessEJB;
//import ibase.webitm.ejb.ITMDBAccessLocal;
import ibase.webitm.utility.ITMException;
@Stateless
......@@ -33,16 +33,22 @@ public class EmpDetChgCancel extends ActionHandlerEJB implements EmpDetChgCancel
int updCount = 0;
AppConnectParm appConnect = null;
InitialContext initialCtx = null;
ITMDBAccessLocal itmDBAccess = null;
//Added & Commented by sarita to use object of ITMDBAccessEJB instead ITMDBAccessLocal on 20 JULY 18.[START]
//ITMDBAccessLocal itmDBAccess = null;
ITMDBAccessEJB itmDBAccess = null;
//Added & Commented by sarita to use object of ITMDBAccessEJB instead ITMDBAccessLocal on 20 JULY 18.[END]
E12GenericUtility genericUtility = null;
String loginCode = "";
String loginEmpCode = "";
try
{
conn = getConnection();
appConnect = new AppConnectParm();
initialCtx = new InitialContext(appConnect.getProperty());
itmDBAccess = (ITMDBAccessLocal)initialCtx.lookup("ibase/ITMDBAccessEJB/local");
//Added & Commented by sarita to create object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [START]
//appConnect = new AppConnectParm();
//initialCtx = new InitialContext(appConnect.getProperty());
//itmDBAccess = (ITMDBAccessLocal)initialCtx.lookup("ibase/ITMDBAccessEJB/local");
itmDBAccess = new ITMDBAccessEJB();
//Added & Commented by sarita to create object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [END]
genericUtility = new E12GenericUtility();
loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
......@@ -93,14 +99,20 @@ public class EmpDetChgCancel extends ActionHandlerEJB implements EmpDetChgCancel
}
if("X".equalsIgnoreCase(status))
{
retString = itmDBAccess.getErrorString( "", "VTCANC2" , loginCode);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString( "", "VTCANC2" , loginCode);
retString = itmDBAccess.getErrorString("","VTCANC2",loginCode,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
return retString;
}
//If transaction in confirmed then unable to cancel the transaction else update the status as "X" in employee_det_change table.
//if("Y".equalsIgnoreCase(confirmed))
else if("C".equalsIgnoreCase(status))
{
retString = itmDBAccess.getErrorString( "", "VTCONF8" , loginCode);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString( "", "VTCONF8" , loginCode);
retString = itmDBAccess.getErrorString("","VTCONF8",loginCode,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
return retString;
}
//else if("N".equalsIgnoreCase(confirmed) || confirmed == null)
......@@ -130,7 +142,10 @@ public class EmpDetChgCancel extends ActionHandlerEJB implements EmpDetChgCancel
{
conn.commit();
System.out.println("Connection commit................");
retString = itmDBAccess.getErrorString( "", "VTCANC1" , loginCode);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString( "", "VTCANC1" , loginCode);
retString = itmDBAccess.getErrorString("","VTCANC1",loginCode,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
}
else
{
......@@ -144,7 +159,10 @@ public class EmpDetChgCancel extends ActionHandlerEJB implements EmpDetChgCancel
{
System.out.println("SQL Exception from [EmpDetChgCanc][confirm][" + se.getMessage()+ "]");
se.printStackTrace();
retString = itmDBAccess.getErrorString( "", "DS00000000" , loginCode);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString( "", "DS00000000" , loginCode);
retString = itmDBAccess.getErrorString("","DS00000000",loginCode,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
return retString;
}
catch(Exception e)
......
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