Hi Naresh,

Let us cinsider a session bean with name AccountBean , home AccountHome and
public interface  Account. Assume that, in your deployment descriptor you
have given the JNDIName (beanHomeName) as sessionbean.account.

We can use the following syntax to create the session bean :


      Context ctx = new InitialContext();
      AccountHome home = (AccountHome) ctx.lookup("sessionbean.account");
      Account ac = null;
      ac = home.create(accountId, balance);

Once you create this, you can call the business methods from session bean as
required. You can also pass properties like INITIAL_CONTEXT_FACTORY to
InitialContext.

Hope this will help you.

Pidix




> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Naresh
> Sent: Friday, May 05, 2000 2:16 AM
> To: [EMAIL PROTECTED]
> Subject: Servlets & Session Bean
>
>
> hello
>
> Can anyone tell how a servlet can communicate with a session bean..?
>
> thanks
> naresh
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to