EJB Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to EJB Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Answer : D

Explaination

Entity beans represents persistent data storage. User data can be saved to database via entity beans and later on can be retrived from the database in the entity bean.

Answer : A

Explaination

A local session bean is used in EJB if ejb client is in same environment where ejb session bean is to be deployed.

Answer : B

Explaination

messageListenerInterface attribute in @javax.ejb.MessageDrivenBean annotation is used to specify message listener interface for the message driven bean.

Answer : A

Explaination

name attribute in @javax.ejb.EJB annotation is used to specify name which will be used to locate the referenced bean in environment.

Q 5 - Which of the following annotation is used to specify Local interface(s) of a session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.Local

D - @javax.ejb.EJB

Answer : C

Explaination

@javax.ejb.Local annotation is used to specify Local interface(s) of a session bean.

Answer : C

Explaination

@PreRemove - method is invoked when an entity is deleted from the database.

Q 7 - Which annotation is used to inject an datasource into an ejb?

A - @EJB

B - @Resource

C - Both of the above.

D - None of the above.

Answer : B

Explaination

@Resource annotation is used to inject an datasource into an ejb.

Answer : A

Explaination

A java POJO to be embedded must be annotated as @Embeddable.

Answer : A

Explaination

Start - When to start a transaction in a business method.

Answer : A

Explaination

JNDI stands for Java Naming and Directory Interface.

ejb_questions_answers.htm
Advertisements