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 : 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 is invoked by EJB container when it receives a message from queue or topic?

A - session bean.

B - entity bean.

C - message driven bean.

D - None of the above.

Answer : C

Explaination

Message driven bean is invoked by EJB container when it receives a message from queue or topic.

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 Remote interface(s) of a session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.Remote

D - @javax.ejb.EJB

Answer : C

Explaination

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

Answer : C

Explaination

@PostActivate - method is invoked when a bean is loaded to be used.

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

Atomic - If any of work item fails, the complete unit is considered failed. Success meant all items executes successfully.

Answer : B

Explaination

Any exception which is not caused by business logic or business code. RuntimeException, RemoteException are SystemException will be treated as system level exception.

ejb_questions_answers.htm
Advertisements