Wednesday, December 9, 2009

[Java] Diff in Calling Ejb from Servlet and Swing Client

 

Hi

Is there any difference in calling a EJB from Servlet/JSP or from our plain
java classes say like from a simple Swing class or a plain java class in BO
Layer.

Pseudo code for calling EJB is like

Properties props=new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
props.put(Context.PROVIDER_URL,"iiop://localhost:900");
Context ctx=new InitialContext(props);
Object obj=ctx.lookup("SAMPLEBOX");
BoxHome boxHome=(BoxHome)PortableRemoteObject.narrow(obj,BoxHome.class);
Box box=boxHome.create();

Please explain.

--
Thanks & Regards,
Manish Kumar Agarwal

[Non-text portions of this message have been removed]

__._,_.___
Visit http://aiaiai.com or http://jgame.org for more groups to join.
Java Official Group is created for the following topics: Java 2 Enterprise Edition - J2EE, Java 2 Standard Edition - J2SE, Java 2 Micro Edition - J2ME, XML, XSL, XSD, XPATH, Web Services, Jini, JXTA for all type of Java Geeks.
Whoever posts spam / ads / job related message will be BANNED IMMEDIATELY
.

__,_._,___

No comments:

Post a Comment