Commit fa2370d9 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@187993 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ee58d714
...@@ -13,7 +13,10 @@ import javax.naming.InitialContext; ...@@ -13,7 +13,10 @@ import javax.naming.InitialContext;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
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.GenericUtility; import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
...@@ -34,6 +37,7 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo ...@@ -34,6 +37,7 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false); conn.setAutoCommit(false);
System.out.println("tranID::::::::::"+tranID); System.out.println("tranID::::::::::"+tranID);
resultStr = mpreqApprove(tranID,xtraParams, forcedFlag, conn); resultStr = mpreqApprove(tranID,xtraParams, forcedFlag, conn);
...@@ -76,7 +80,10 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo ...@@ -76,7 +80,10 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo
String apprvDateStr="",errString="",approved="",logCode=""; String apprvDateStr="",errString="",approved="",logCode="";
boolean isError =false; boolean isError =false;
int cnt = 0; int cnt = 0;
ITMDBAccessLocal itmdbAccessLocal = null ; //Added & Commented by sarita to use object of ITMDBAccessEJB instead ITMDBAccessLocal on 20 JULY 18.[start]
//ITMDBAccessLocal itmdbAccessLocal = null ;
ITMDBAccessEJB itmDBAccess = null;
//Added & Commented by sarita to use object of ITMDBAccessEJB instead ITMDBAccessLocal on 20 JULY 18.[end]
PreparedStatement pstmt =null; PreparedStatement pstmt =null;
ResultSet rs = null; ResultSet rs = null;
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
...@@ -84,10 +91,13 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo ...@@ -84,10 +91,13 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo
try try
{ {
AppConnectParm appConnect = new AppConnectParm(); //Added & Commented by sarita to create object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [START]
/*AppConnectParm appConnect = new AppConnectParm();
Properties p = appConnect.getProperty(); Properties p = appConnect.getProperty();
InitialContext ctx = new InitialContext(p); InitialContext ctx = new InitialContext(p);
itmdbAccessLocal = (ITMDBAccessLocal)ctx.lookup("ibase/ITMDBAccessEJB/local"); itmdbAccessLocal = (ITMDBAccessLocal)ctx.lookup("ibase/ITMDBAccessEJB/local");*/
itmDBAccess = new ITMDBAccessEJB();
//Added & Commented by sarita to create object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [END]
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
java.util.Date currDate = new java.util.Date(); java.util.Date currDate = new java.util.Date();
apprvDateStr = sdf.format(currDate); apprvDateStr = sdf.format(currDate);
...@@ -119,7 +129,10 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo ...@@ -119,7 +129,10 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo
if ((approved != null && approved.trim().length() > 0) && approved.trim().equals("Y")) if ((approved != null && approved.trim().length() > 0) && approved.trim().equals("Y"))
{ {
isError = true; isError = true;
errString = itmdbAccessLocal.getErrorString("","VTCONFDUP",""); //Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//errString = itmdbAccessLocal.getErrorString("","VTCONFDUP","");
errString = itmDBAccess.getErrorString("","VTCONFDUP","","",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
return errString; return errString;
} }
else else
...@@ -136,7 +149,10 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo ...@@ -136,7 +149,10 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo
else else
{ {
isError = true; isError = true;
errString = itmdbAccessLocal.getErrorString("","VTMCONF20",""); //Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//errString = itmdbAccessLocal.getErrorString("","VTMCONF20","");
errString = itmDBAccess.getErrorString("","VTMCONF20","","",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
return errString; return errString;
} }
...@@ -163,7 +179,10 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo ...@@ -163,7 +179,10 @@ public class MPReqmntConfirmation extends ActionHandlerEJB implements MPReqmntCo
System.out.println("Commiting Changes......"); System.out.println("Commiting Changes......");
conn.commit(); conn.commit();
isError = true; isError = true;
errString = itmdbAccessLocal.getErrorString("","VTCONF",""); //Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//errString = itmdbAccessLocal.getErrorString("","VTCONF","");
errString = itmDBAccess.getErrorString("","VTCONF","","",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
return errString; return errString;
} }
......
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