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

Explaination

description attribute in @javax.ejb.Stateless annotation is used to provide description of the session bean.

Answer : D

Explaination

description attribute in @javax.ejb.MessageDrivenBean annotation is used to provide description of the message driven bean.

Answer : D

Explaination

@javax.ejb.Local annotation is used to specify Local interface(s) of a session bean. This local interface states the business methods of the session bean (which can be stateless or stateful). This interface is used to expose the business methods to local clients which are running in same deployment/application as EJB.

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.

Q 8 - EJB 3.0 provides support for Blob and Clob types using @Lob annotation.

A - true

B - false

Answer : A

Explaination

EJB 3.0 provides support for Blob and Clob types using @Lob annotation.

Answer : B

Explaination

Success - Identify success scenario when a transaction is to be committed.

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