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

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

Explaination

EntityManager is an interface to do data operations like add/delete/update/find on persistent object. It also helps to execute queries using Query interface.

Answer : D

Explaination

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

Q 5 - Which of the following annotation is used to specify callback method of ejb lifecycle?

A - @javax.ejb.PostActivate

B - @javax.ejb.Local

C - @javax.ejb.Remote

D - @javax.ejb.EJB

Answer : A

Explaination

@javax.ejb.PostActivate annotation is used to specify callback method of ejb lifecycle.

Answer : A

Explaination

@PrePersist - method is invoked when an entity is created in database.

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

A - @EJB

B - @Resource

C - Both of the above.

D - None of the above.

Answer : A

Explaination

@EJB annotation is used to inject other EJB reference.

Answer : A

Explaination

ACID stands for Atomic, Consistent,Isolated and Durable.

ejb_questions_answers.htm
Advertisements