Commit ee58d714 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@187992 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9316e8bf
...@@ -15,7 +15,10 @@ import ibase.system.config.AppConnectParm; ...@@ -15,7 +15,10 @@ import ibase.system.config.AppConnectParm;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
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;
...@@ -77,16 +80,22 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca ...@@ -77,16 +80,22 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca
String sqlDb=""; String sqlDb="";
int noPost=0,noVacFilled=0,cnt=0; int noPost=0,noVacFilled=0,cnt=0;
boolean isError =false; boolean isError =false;
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();
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();
closeDateStr = sdf.format(currDate); closeDateStr = sdf.format(currDate);
...@@ -150,13 +159,19 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca ...@@ -150,13 +159,19 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca
if(!approved.trim().equalsIgnoreCase("Y")) if(!approved.trim().equalsIgnoreCase("Y"))
{ {
isError = true; isError = true;
errString = itmdbAccessLocal.getErrorString("","VTNOCONF1",""); //Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//errString = itmdbAccessLocal.getErrorString("","VTNOCONF1","");
errString = itmDBAccess.getErrorString("","VTNOCONF1","","",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
return errString; return errString;
} }
else if(status.trim().equalsIgnoreCase("C") || noPost <= noVacFilled) else if(status.trim().equalsIgnoreCase("C") || noPost <= noVacFilled)
{ {
isError = true; isError = true;
errString = itmdbAccessLocal.getErrorString("","VTVACCL",""); //Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//errString = itmdbAccessLocal.getErrorString("","VTVACCL","");
errString = itmDBAccess.getErrorString("","VTVACCL","","",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
return errString; return errString;
} }
else else
...@@ -173,7 +188,10 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca ...@@ -173,7 +188,10 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca
if(cnt > 0) if(cnt > 0)
{ {
isError = true; isError = true;
errString = itmdbAccessLocal.getErrorString("","VTVACCL3",""); //Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//errString = itmdbAccessLocal.getErrorString("","VTVACCL3","");
errString = itmDBAccess.getErrorString("","VTVACCL3","","",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
return errString; return errString;
} }
else else
...@@ -210,7 +228,10 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca ...@@ -210,7 +228,10 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca
System.out.println("Commiting Changes......"); System.out.println("Commiting Changes......");
conn.commit(); conn.commit();
isError = true; isError = true;
errString = itmdbAccessLocal.getErrorString("","VTVACCL2",""); //Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//errString = itmdbAccessLocal.getErrorString("","VTVACCL2","");
errString = itmDBAccess.getErrorString("","VTVACCL2","","",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