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

A remote session bean is used in EJB if ejb client is in different environment where ejb session bean is to be deployed.

Answer : D

Explaination

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

Q 4 - Which of the following annotation is used to specify that a given ejb class is a stateful session bean?

A - @javax.ejb.Stateless

B - @javax.ejb.Stateful

C - @javax.ejb.MessageDrivenBean

D - @javax.ejb.EJB

Answer : B

Explaination

@javax.ejb.Stateful annotation specifies that a given ejb class is a stateful session bean.

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

A - true

B - false

Answer : A

Explaination

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

Answer : D

Explaination

@PrePassivate - method is invoked when a bean is put back to bean pool.

Answer : B

Explaination

@PostLoad - is invoked when a record is fetched from database and loaded into the entity.

Answer : C

Explaination

A transaction is a single unit of work items which follows the ACID properties.

Answer : A

Explaination

MANDATORY - Indicates that business method will execute as part of transaction otherwise exception will be thrown.

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