EJB Online Quiz


Advertisements


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.

Q 2 - Which of the following bean stores data of a particular user for a single session?

A - session bean.

B - entity bean.

C - message driven bean.

D - None of the above.

Answer : A

Explaination

Session bean stores data of a particular user for a single session.

Answer : A

Explaination

name attribute in @javax.ejb.MessageDrivenBean annotation is used to specify name of the message driven bean.

Answer : D

Explaination

mappedName attribute in @javax.ejb.EJB annotation is used to specify the JNDI name of the referenced bean.

Q 5 - @javax.ejb.Remote annotation is used to specify Remote interface(s) of a session bean.

A - false

B - true

Answer : B

Explaination

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

Answer : B

Explaination

@PreDestroy - method is invoked when a bean is removed from the bean pool or is destroyed.

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 : B

Explaination

REQUIRES_NEW - Indicates that a new transaction is to be started for the business method.

Answer : D

Explaination

JNDI stands for Java Naming and Directory Interface. It is a set of API and service interfaces. Java based applications use JNDI for naming and directory services.


ejb_questions_answers.htm

Advertisements