G  Tech Lab
About us   |   Contact us   |   Help
Site Search   
G Tech Lab News
G Tech Lab Java Centre
G Tech Lab Provides different interview question and answer, tutorials .
Shortly comming up.... forum for different programming languages.
Read more
INTERVIEW QUESTION

JAVA

Core Java Interview Question
JSP Interview Question
Servlet Interview Question
EJB Interview Question

DATABASE

SQL Interview Question
ORACLE Interview Question
SQL SERVER Interview Question
My SQL Interview Question

1) What is software architecture of EJB?

Session and Entity EJBs consist of 4 and 5 parts respetively:

1. A remote interface (a client interacts with it),

2. A home interface (used for creating objects and for declaring business methods),

3. A bean object (an object, which actually performs business logic and EJB-specific operations).

4. A deployment descriptor (an XML file containing all information required for maintaining the EJB) or a set of deployment descriptors (if you are using some container-specific features).

5.A Primary Key class - is only Entity bean specific.

2) What is the difference between EJB and Java beans?

  • EJB is a specification for J2EE server, not a product; Java beans may be a graphical component in IDE.

3) What is the difference between session and entity beans?

An entity bean represents persistent global data from the database; a session bean represents transient user-specific data that will die when the user disconnects (ends his session). Generally, the session beans implement business methods (e.g. Bank.transferFunds) that call entity beans (e.g. Account.deposit, Account.withdraw)

4) What is the relationship between local interfaces and container-managed relationships?
Entity beans that have container-managed relationships with other entity beans, must be accessed in the same local scope as those related beans, and therefore typically provide a local client view. In order to be the target of a container-managed relationship, an entity bean with container-managed persistence must provide a local interface.

5) What is EJB QL and where can be used ?
EJB QL stands for Enterprise Java Beans Query Language . It is abstraction of underlying data storage for example SQL. It can be used in J2EE application to provide portability of an application.

6)What is the difference between EJB 2.x and 3.0 ?

You are no longer required to create the EJB deployment descriptor files (such as ejb-jar.xml). You can now use metadata annotations in the bean file itself to configure metadata. You are still allowed, however, to use XML deployment descriptors if you want; in the case of conflicts, the deployment descriptor value overrides the annotation value.
• The bean file can be a plain Java object (or POJO); it is no longer required to implement javax.ejb.SessionBean or javax.ejb.MessageDrivenBean.
• As a result of not having to implement javax.ejb.SessionBean or javax.ejb.MessageDrivenBean, the bean file no longer has to implement the lifecycle callback methods, such as ejbCreate, ejbPassivate, and so on. If, however, you want to implement these callback methods, you can name them anything you want and then annotate them with the appropriate annotation, such as @javax.ejb.PostActivate.
• The bean file is required to use a business interface. The bean file can either explicitly implement the business interface or it can specify it using the @javax.ejb.Remote or @javax.ejb.Local annotations.)
• The business interface is a plain Java interface (or POJI); it should not extend javax.ejb.EJBObject or javax.ejb.EJBLocalObject.
• The business interface methods should not throw java.rmi.RemoteException.

Page 1


Download
Netbeans IDE 5.5.1. Download
J2SE SDK Download J2RE Download Application Server Download Latest JDK Download JCreator Download JDevloper Download