Discussion:
Newbie - EJB question
(too old to reply)
Z***@hotmail.com
2008-11-02 01:10:22 UTC
Permalink
I am just learning EJB. It says EJB has 2 interfaces - home and
component interface - but don't see where this interfaces are
implemented. A book example (EJB in 21 days) shows a code how a client
looks for interface using JNDI - but how this home interface was
instantiented?

Thanks

Zalek
Mark Space
2008-11-02 01:22:27 UTC
Permalink
Post by Z***@hotmail.com
I am just learning EJB. It says EJB has 2 interfaces - home and
component interface - but don't see where this interfaces are
implemented. A book example (EJB in 21 days) shows a code how a client
looks for interface using JNDI - but how this home interface was
instantiented?
I never had any luck with the "in 21 days" series. Could be more
specific about your question? According to Sun's tutorial, it's just a
regular old Java class.

import javax.ejb.EntityBean;

public class CustomerBean
implements EntityBean {
//...
}

<http://java.sun.com/developer/onlineTraining/EJBIntro/EJBIntro.html>

But with out a little more knowledge about what your doing it's kinda
hard to fill in details. I assume that the compiled bean class is then
deployed to the EJB Container somehow.
zalek
2008-11-02 01:46:37 UTC
Permalink
Post by Z***@hotmail.com
I am just learning EJB. It says EJB has 2 interfaces - home and
component interface - but don't see where this interfaces are
implemented. A book example (EJB in 21 days) shows a code how a client
looks for interface using JNDI - but how this home interface was
instantiented?
I never had any luck with the "in 21 days" series.  Could be more
specific about your question?  According to Sun's tutorial, it's just a
regular old Java class.
   import javax.ejb.EntityBean;
   public class CustomerBean
                implements EntityBean {
   //...
   }
<http://java.sun.com/developer/onlineTraining/EJBIntro/EJBIntro.html>
But with out a little more knowledge about what your doing it's kinda
hard to fill in details.  I assume that the compiled bean class is then
deployed to the EJB Container somehow.
Well - as I understand EJB is more complicated - a client cannot
access directly EJB - first it used a home interface to create EJB and
then using component interface is using method defined in EJB.
What I don't understand - how those interfaces are instantiatiented.

I wrote a JSP/java web servlet and want to convert it to EJB. The
servlet is very simple - it updates/inserts/shows a database.

Zalek

Loading...