- EJB Tutorial
- EJB - Home
- EJB - Overview
- EJB - Environment Setup
- EJB - Create Application
- EJB - Stateless Bean
- EJB - Stateful Bean
- EJB - Persistence
- EJB - Message Driven Beans
- EJB - Annotations
- EJB - Callbacks
- EJB - Timer Service
- EJB - Dependency Injection
- EJB - Interceptors
- EJB - Embeddable Objects
- EJB - Blobs/Clobs
- EJB - Transactions
- EJB - Security
- EJB - JNDI Bindings
- EJB - Entity Relationships
- EJB - Access Database
- EJB - Query Language
- EJB - Exception Handling
- EJB - Web Services
- EJB - Packaging Applications
- EJB Useful Resources
- EJB - Quick Guide
- EJB - Useful Resources
- EJB - Discussion
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.
Q 1 - Which of the following is true about message driven bean?
A - Message driven bean is a stateless bean.
Answer : D
Explaination
A message driven bean is a type of enterprise bean which is invoked by EJB container when it receives a message from queue or topic. Message driven bean is a stateless bean and is used to do task asynchronously.
Q 2 - When a local session bean is used in EJB?
Answer : A
Explaination
A local session bean is used in EJB if ejb client is in same environment where ejb session bean is to be deployed.
Q 3 - Which of the following is correct about description attribute in @javax.ejb.Stateless annotation?
A - It is used to specify name of the session bean.
B - it is used to specify the JNDI name of the session bean.
Answer : C
Explaination
description attribute in @javax.ejb.Stateless annotation is used to provide description of the session bean.
Q 4 - Which of the following is correct about mappedName attribute in @javax.ejb.EJB annotation?
A - It is used to specify name which will be used to locate the referenced bean in environment.
B - it is used to specify the interface type of the referenced bean.
C - It is used to provide name of the referenced bean.
D - It is used to specify the JNDI name of the referenced bean.
Answer : D
Explaination
mappedName attribute in @javax.ejb.EJB annotation is used to specify the JNDI name of the referenced bean.
Q 5 - Which of the following annotation is used to specify properties required for a message driven bean?
Answer : A
Explaination
@javax.ejb.ActivationConfigProperty annotation is used to specify properties required for a message driven bean.
Q 6 - Which of the following is correct about @PreRemove annotation for a entity bean?
A - Method is invoked when an entity is created in database.
B - Method is invoked after an entity is created in database.
C - Method is invoked when an entity is deleted from the database.
D - Method is invoked after an entity is deleted from the database.
Answer : C
Explaination
@PreRemove - method is invoked when an entity is deleted from the database.
Q 7 - Which of the following is correct about Class level interceptor in EJB?
A - Such interceptor is invoked for every method of the bean.
B - Such interceptor is invoked for every bean within deployment.
C - Such interceptor is invoked for a particular method of the bean.
Answer : A
Explaination
Class level interceptor is invoked for every method of the bean.
Answer : A
Explaination
EJB 3.0 provides support for Blob and Clob types using @Lob annotation.
Q 9 - Which of the following is correct about a DeclareRoles attrribute of Container Managed Transactions in EJB?
A - Indicates that class will accept those declared roles. Annotations are applied at class level.
Answer : A
Explaination
DeclareRoles - Indicates that class will accept those declared roles. Annotations are applied at class level.
Q 10 - Which of the following is true about exceptions handling by EJB Container?
B - EJB Container wraps the exception into RemoteException and throws it to the client.
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.
To Continue Learning Please Login
Login with Google