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.

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

Explaination

beanInterface attribute in @javax.ejb.EJB annotation is used to specify the interface type of the referenced bean.

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.

Answer : A

Explaination

Class level interceptor is invoked for every method of the bean.

Q 8 - Which of the following types of java classes can be mapped using @Lob annotation?

A - java.sql.Blob

B - java.sql.Clob

C - Both of the above.

D - None of the above.

Answer : C

Explaination

Both of the above classes can be mapped using @Lob annotation.

Answer : B

Explaination

NEVER - Indicates if business method executes as part of transaction then an exception will be thrown.

ejb_questions_answers.htm
Advertisements