Commit 2f431445 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@187997 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fa2370d9
...@@ -13,7 +13,10 @@ import ibase.system.config.AppConnectParm; ...@@ -13,7 +13,10 @@ import ibase.system.config.AppConnectParm;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ActionHandlerEJB; import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessLocal; //Added and commented by sarita on 20 JULY 18 [START]
import ibase.webitm.ejb.ITMDBAccessEJB;
//import ibase.webitm.ejb.ITMDBAccessLocal;
//Added and commented by sarita on 20 JULY 18 [END]
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
@Stateless @Stateless
...@@ -28,16 +31,22 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo ...@@ -28,16 +31,22 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo
E12GenericUtility genericUtility = null; E12GenericUtility genericUtility = null;
AppConnectParm appConnect = null; AppConnectParm appConnect = null;
InitialContext initialCtx = 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]
String loginCode = ""; String loginCode = "";
try try
{ {
conn = getConnection(); conn = getConnection();
genericUtility = new E12GenericUtility(); genericUtility = new E12GenericUtility();
appConnect = new AppConnectParm(); //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()); initialCtx = new InitialContext(appConnect.getProperty());
itmDBAccess = (ITMDBAccessLocal)initialCtx.lookup("ibase/ITMDBAccessEJB/local"); 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]
loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
System.out.println("loginCode---["+loginCode+"]"); System.out.println("loginCode---["+loginCode+"]");
...@@ -49,7 +58,10 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo ...@@ -49,7 +58,10 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo
{ {
conn.commit(); conn.commit();
System.out.println("Connection 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 else
{ {
...@@ -112,14 +124,19 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo ...@@ -112,14 +124,19 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo
E12GenericUtility genericUtility = null; E12GenericUtility genericUtility = null;
AppConnectParm appConnect = null; AppConnectParm appConnect = null;
InitialContext initialCtx = null; InitialContext initialCtx = null;
ITMDBAccessLocal itmDBAccess = null; //Added & Commented by sarita to use object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [START]
//ITMDBAccessLocal itmDBAccess = null;
ITMDBAccessEJB itmDBAccess = null;
//Added & Commented by sarita to use object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [END]
try try
{ {
genericUtility = new E12GenericUtility(); genericUtility = new E12GenericUtility();
appConnect = new AppConnectParm(); //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()); initialCtx = new InitialContext(appConnect.getProperty());
itmDBAccess = (ITMDBAccessLocal)initialCtx.lookup("ibase/ITMDBAccessEJB/local"); 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]
loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
System.out.println("loginCode---["+loginCode+"]"); System.out.println("loginCode---["+loginCode+"]");
...@@ -169,12 +186,18 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo ...@@ -169,12 +186,18 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo
//if("X".equalsIgnoreCase(status)) //if("X".equalsIgnoreCase(status))
if("X".equalsIgnoreCase(confirmed)) if("X".equalsIgnoreCase(confirmed))
{ {
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; return retString;
} }
if("Y".equalsIgnoreCase(confirmed)) if("Y".equalsIgnoreCase(confirmed))
{ {
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; return retString;
} }
else if("N".equalsIgnoreCase(confirmed) || confirmed == null) else if("N".equalsIgnoreCase(confirmed) || confirmed == null)
...@@ -222,7 +245,10 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo ...@@ -222,7 +245,10 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo
} }
else else
{ {
retString = itmDBAccess.getErrorString( "", "VTCANC3" , loginCode); //Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString( "", "VTCANC3" , loginCode);
retString = itmDBAccess.getErrorString("","VTCANC3",loginCode,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
return retString; return retString;
} }
} }
...@@ -230,7 +256,10 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo ...@@ -230,7 +256,10 @@ public class PayrVouchCanc extends ActionHandlerEJB implements PayrVouchCancRemo
{ {
System.out.println("SQL Exception from [PayrVouchCanc][confirm][" + se.getMessage()+ "]"); System.out.println("SQL Exception from [PayrVouchCanc][confirm][" + se.getMessage()+ "]");
se.printStackTrace(); 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; return retString;
} }
catch( Exception e ) 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