|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.ibm.websphere.samples.ejbquery.ejbmediatorwar.EjbMediatorSample
public class EjbMediatorSample
This is a sample program showing how to call the EJB Data Mediator Service. The simplest way to run the sample is to open a browser to the url http://localhost:9080/DynamicQuery/EjbMediatorWeb/index.html, enter EJB query select statements and press the "Submit" button. The EJB query can be on multiple lines but the select statements must be separated by semicolon (";") characters. Example: select d.deptno, d.name from DeptBean as d; select e.* from in (d.emps) as e
Constructor Summary | |
---|---|
EjbMediatorSample()
|
Method Summary | |
---|---|
void |
_processQuery(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
The _processQuery method uses the input query to create a mediator and then calls getGraph() on the EJB Mediator. |
void |
displayGraph(javax.servlet.http.HttpSession thisSession,
javax.servlet.http.HttpServletRequest req,
java.io.PrintWriter out,
commonj.sdo.DataGraph g)
/** The displayGraph method shows the DataGraph that is returned after the mediator query and any subsequent DataObject commands are issued. |
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
The doPost method checks if the ejb application is installed and started then processes the query. |
void |
init()
The init method is used to retrieve the InitialContext for the application server namespace and the UserTransaction from the application server namespace. |
void |
installCheck()
The installCheck method checks if the datasource and ejb home for the sample are installed correctly. |
protected java.lang.Object |
lookup(java.lang.String name,
java.lang.String message)
The lookup method is a utility method to retrieve references from the application server namespace. |
protected java.lang.String[] |
parse(java.lang.String qs)
The parse method converts a select query String which may contain several select statements separated by semicolons on one or more lines into an array of single select statements. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.Servlet |
---|
destroy, getServletConfig, getServletInfo, init, service |
Constructor Detail |
---|
public EjbMediatorSample()
Method Detail |
---|
public void _processQuery(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws java.lang.Exception
req
- javax.servlet.HttpServletRequestresp
- javax.servlet.HttpServletResponse
java.lang.Exception
public void displayGraph(javax.servlet.http.HttpSession thisSession, javax.servlet.http.HttpServletRequest req, java.io.PrintWriter out, commonj.sdo.DataGraph g) throws java.lang.Exception
thisSession
- javax.servlet.HttpSessionreq
- javax.servlet.HttpServletRequestout
- java.io.PrintWriter
java.lang.Exception
protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
doPost
in class javax.servlet.http.HttpServlet
req
- javax.servlet.HttpServletRequestresp
- javax.servlet.HttpServletResponse
javax.servlet.ServletException,
- java.io.IOException
javax.servlet.ServletException
java.io.IOException
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void installCheck() throws java.lang.Exception
java.lang.Exception
protected java.lang.Object lookup(java.lang.String name, java.lang.String message) throws javax.servlet.ServletException
name
- String Name of Application Object to be retrieved.message
- String Error message to return
javax.servlet.ServletException
protected java.lang.String[] parse(java.lang.String qs) throws java.lang.Exception
qs
- java.lang.String
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |