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;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
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.ITMException;
......@@ -77,16 +80,22 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca
String sqlDb="";
int noPost=0,noVacFilled=0,cnt=0;
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;
ResultSet rs = null;
GenericUtility genericUtility = GenericUtility.getInstance();
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();
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());
java.util.Date currDate = new java.util.Date();
closeDateStr = sdf.format(currDate);
......@@ -150,13 +159,19 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca
if(!approved.trim().equalsIgnoreCase("Y"))
{
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;
}
else if(status.trim().equalsIgnoreCase("C") || noPost <= noVacFilled)
{
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;
}
else
......@@ -173,7 +188,10 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca
if(cnt > 0)
{
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;
}
else
......@@ -210,7 +228,10 @@ public class MPReqmntClose extends ActionHandlerEJB implements MPReqmntCloseLoca
System.out.println("Commiting Changes......");
conn.commit();
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;
}
......
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