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 : 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 : 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 properties required for a message driven bean?

A - @javax.ejb.ActivationConfigProperty

B - @javax.ejb.Local

C - @javax.ejb.Remote

D - @javax.ejb.EJB

Answer : A

Explaination

@javax.ejb.ActivationConfigProperty annotation is used to specify properties required for a message driven bean.

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

Explaination

When System Exception occurs, ejb container intercepts the exception, rollbacks the transaction and start the clean up tasks. It wraps the exception into RemoteException and throws it to the client.

ejb_questions_answers.htm
Advertisements