Commit bc1f7cfe authored by prane's avatar prane

changes done creating instance of the class using new keyword instead of lookup of EJB

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@188001 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cd8b7807
package ibase.webitm.ejb.dis;
import ibase.scheduler.utility.interfaces.Schedule;
import ibase.system.config.AppConnectParm;
import ibase.system.config.ConnDriver;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
import ibase.webitm.ejb.MasterApplyEJBLocal;
import ibase.webitm.ejb.MasterApplyEJB;
import ibase.webitm.utility.ITMException;
import java.sql.Connection;
import java.sql.PreparedStatement;
......@@ -13,7 +12,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import javax.naming.InitialContext;
import javax.xml.rpc.ParameterMode;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
......@@ -82,7 +80,7 @@ public class BatchLoadIdSpecificSch implements Schedule
// String xtraParams = null;
// AppConnectParm appConnect = new AppConnectParm();
// InitialContext ctx = new InitialContext ( appConnect.getProperty() );
// MasterApplyEJBLocal masterApplyLocal = ( MasterApplyEJBLocal ) ctx.lookup("ibase/MasterApplyEJB/local");
//
// while( rs.next())
// {
// batchId = rs.getString("BATCH_ID");
......@@ -114,11 +112,8 @@ public class BatchLoadIdSpecificSch implements Schedule
String xtraParams = null;
UserInfoBean userInfo = new ibase.utility.UserInfoBean( scheduleParamXML );
xtraParams = "loginCode="+userInfo.getLoginCode()+"~~termId="+userInfo.getRemoteHost()+"~~loginSiteCode="+userInfo.getSiteCode()+"~~loginEmpCode="+userInfo.getEmpCode()+"~~runMode="+runMode;
AppConnectParm appConnect = new AppConnectParm();
InitialContext ctx = new InitialContext ( appConnect.getProperty() );
MasterApplyEJBLocal masterApplyLocal = ( MasterApplyEJBLocal ) ctx.lookup("ibase/MasterApplyEJB/local");
xtraParams = "loginCode="+userInfo.getLoginCode()+"~~termId="+userInfo.getRemoteHost()+"~~loginSiteCode="+userInfo.getSiteCode()+"~~loginEmpCode="+userInfo.getEmpCode()+"~~runMode="+runMode;
MasterApplyEJB masterApplyLocal = new MasterApplyEJB();
/*Added update sql to change the window name by Nikhil on dated 15/07/16*/
int upCnt= 0;
......
......@@ -6,23 +6,21 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.zip.GZIPOutputStream;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import ibase.bi.utility.Messages;
import ibase.system.config.AppConnectParm;
import ibase.utility.CommonConstants;
import ibase.webitm.ejb.dis.PricelistGenWizEJBRemote;
import ibase.webitm.ejb.dis.PricelistGenWizEJB;
import ibase.webitm.utility.ITMException;
public class PlistgenWizServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
InitialContext ctx = null;
//InitialContext ctx = null;
public PlistgenWizServlet() {
super();
......@@ -39,7 +37,7 @@ public class PlistgenWizServlet extends HttpServlet
request.setCharacterEncoding(CommonConstants.ENCODING);
String action = "", responseXML = "", htmlData = "";
PricelistGenWizEJBRemote pricelistGenWizRemote = null;
PricelistGenWizEJB pricelistGenWizRemote = null;
try
{
......@@ -130,8 +128,7 @@ public class PlistgenWizServlet extends HttpServlet
requestParamMap.put("loginUser", loginCode);
System.out.println("Request Parameter map :"+requestParamMap);
ctx=getInitialContext();
pricelistGenWizRemote = (ibase.webitm.ejb.dis.PricelistGenWizEJBRemote) ctx.lookup("ibase/PricelistGenWizEJB/remote");
pricelistGenWizRemote = new PricelistGenWizEJB();
responseXML = pricelistGenWizRemote.handleRequest(requestParamMap);
response.setContentType("text/xml");
......@@ -163,24 +160,4 @@ public class PlistgenWizServlet extends HttpServlet
System.out.println("XXXXXXXXXXXXXXXXXXXXXX[ PlistgenWizServlet END]XXXXXXXXXXXXXXXXXXXX");
}
protected InitialContext getInitialContext()throws ITMException
{
InitialContext ctx = null;
try
{
AppConnectParm appConnect = new AppConnectParm();
ctx = new InitialContext(appConnect.getProperty());
}
catch(ITMException itme)
{
System.out.println("PlistgenWizServlet.getInitialContext()");
throw itme;
}
catch(Exception e)
{
System.out.println("PlistgenWizServlet.getInitialContext()"+e.getMessage());
throw new ITMException(e);
}
return ctx;
}
}
\ No newline at end of file
......@@ -3,7 +3,6 @@ package ibase.webitm.servlet.dis;
import java.util.ArrayList;
import java.util.List;
import javax.naming.InitialContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.FormParam;
......@@ -18,9 +17,9 @@ import javax.ws.rs.core.UriInfo;
import org.json.JSONObject;
import org.json.XML;
import org.w3c.dom.Document;
import ibase.ejb.CommonDBAccessLocal;
import ibase.ejb.CommonDBAccessEJB;
import ibase.servlet.Messages;
import ibase.system.config.AppConnectParm;
import ibase.utility.BaseException;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
......@@ -44,7 +43,7 @@ public class SCMWebService
String retString = "";
ArrayList<String> langAndCountryList = new ArrayList<String>();
CommonDBAccessLocal commonDBAccessLocal = null;
CommonDBAccessEJB commonDBAccessLocal = null;
try
{
if(dataXML == null || dataXML.trim().length() == 0 || userCode == null || userCode.trim().length() == 0 || password == null || password.trim().length() == 0)
......@@ -53,7 +52,7 @@ public class SCMWebService
retString = "<Root><tran_id><![CDATA[]]></tran_id><msg_code><![CDATA[]]></msg_code><msg_descr><![CDATA[Missing required paramters]]></msg_descr><result><![CDATA[FAILED]]></result></Root>";
return Response.status(HttpServletResponse.SC_BAD_REQUEST).entity(retString).build();
}
commonDBAccessLocal = (CommonDBAccessLocal)getInitialContext().lookup("ibase/CommonDBAccessEJB/local");
commonDBAccessLocal = new CommonDBAccessEJB();
String siteCode = commonDBAccessLocal.getDBColumnValue( "USERS", "SITE_CODE__DEF","WHERE CODE = "+"'" +userCode+"'" );
String xmlInfoStr = commonDBAccessLocal.authenticate(userCode, password, siteCode, "I", "true");
System.out.println("authRetString["+xmlInfoStr+"]");
......@@ -151,26 +150,6 @@ public class SCMWebService
return responseString.toString();
}
private InitialContext getInitialContext() throws ITMException
{
InitialContext ctx = null;
try
{
AppConnectParm appConnect = new AppConnectParm();
ctx = new InitialContext( appConnect.getProperty() );
}
catch( ITMException itme )
{
System.out.println( "SCMWebService : getInitialContext : "+ itme.getMessage() );
throw itme;
}
catch(Exception e)
{
System.out.println( "SCMWebService : getInitialContext : "+ e.getMessage() );
throw new ITMException(e);
}
return ctx;
}
//Added By PriyankaC To getBank DATA on 27FEB2018...[START]
@GET
@Path("/getBankDetails")
......
......@@ -5,15 +5,14 @@ import java.io.OutputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.zip.GZIPOutputStream;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import ibase.bi.utility.Messages;
import ibase.system.config.AppConnectParm;
import ibase.utility.CommonConstants;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.dis.StockAllocVerifyWiz;
import ibase.webitm.ejb.dis.StockAllocVerifyWizRemote;
/**
......@@ -21,7 +20,6 @@ import ibase.webitm.ejb.dis.StockAllocVerifyWizRemote;
*/
public class StockAllocVerifyWizServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
InitialContext ctx = null;
public StockAllocVerifyWizServlet() {
super();
......@@ -38,7 +36,7 @@ public class StockAllocVerifyWizServlet extends HttpServlet {
request.setCharacterEncoding(CommonConstants.ENCODING);
String action = "", responseXML = "", htmlData = "";
StockAllocVerifyWizRemote stockAllocVerifyWizRemote = null;
StockAllocVerifyWiz stockAllocVerifyWizRemote = null;
try
{
......@@ -169,8 +167,8 @@ public class StockAllocVerifyWizServlet extends HttpServlet {
requestParamMap.put("loginUser", loginCode);
System.out.println("Request Parameter map :"+requestParamMap);
ctx=getInitialContext();//ibase.webitm.ejb.dis.StockAllocVerifyWiz;
stockAllocVerifyWizRemote = (ibase.webitm.ejb.dis.StockAllocVerifyWizRemote) ctx.lookup("ibase/StockAllocVerifyWiz/remote");
stockAllocVerifyWizRemote = new StockAllocVerifyWiz();
responseXML = stockAllocVerifyWizRemote.handleRequest(requestParamMap);
response.setContentType("text/xml");
......@@ -202,24 +200,4 @@ public class StockAllocVerifyWizServlet extends HttpServlet {
System.out.println("XXXXXXXXXXXXXXXXXXXXXX[ StockAllocVerifyWizServlet END]XXXXXXXXXXXXXXXXXXXX");
}
protected InitialContext getInitialContext()throws ITMException
{
InitialContext ctx = null;
try
{
AppConnectParm appConnect = new AppConnectParm();
ctx = new InitialContext(appConnect.getProperty());
}
catch(ITMException itme)
{
System.out.println("StockAllocVerifyWizServlet.getInitialContext()");
throw itme;
}
catch(Exception e)
{
System.out.println("StockAllocVerifyWizServlet.getInitialContext()"+e.getMessage());
throw new ITMException(e);
}
return ctx;
}
}
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