- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 session bean?
A - Session bean stores data of a particular user for a single session.
B - Session bean can be stateful or stateless.
C - Session bean is less resource intensive as compared to entity beans.
Answer : D
Explaination
Session bean stores data of a particular user for a single session. It can be stateful or stateless. It is less resource intensive as compared to entity beans.
Q 2 - When a remote session bean is used in EJB?
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.
Q 3 - Which of the following is correct about name attribute in @javax.ejb.MessageDrivenBean annotation?
A - It is used to specify name of the message driven bean.
B - it is used to specify message listener interface for the message driven bean.
D - It is used to specify the JNDI name of the message driven bean.
Answer : A
Explaination
name attribute in @javax.ejb.MessageDrivenBean annotation is used to specify name of the message driven bean.
Q 4 - Which of the following is correct about description attribute in @javax.ejb.MessageDrivenBean annotation?
A - It is used to specify name of the message driven bean.
B - it is used to specify message listener interface for the message driven bean.
D - It is used to provide description of the message driven bean.
Answer : D
Explaination
description attribute in @javax.ejb.MessageDrivenBean annotation is used to provide description of the message driven bean.
Q 5 - Which of the following is true about @javax.ejb.Local annotation?
A - @javax.ejb.Local annotation is used to specify Local interface(s) of a session 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.
Q 6 - Which of the following is correct about @PreUpdate annotation for a entity bean?
A - Method is invoked before an entity is to be updated in the 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 : A
Explaination
@PreUpdate - method is invoked before an entity is to be updated in the database.
Q 7 - Which of the following is correct about Default 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 : B
Explaination
Default interceptor is invoked for every bean within deployment.
Q 8 - Which of the following is correct about a transaction in EJB?
A - A transaction is a single unit of work items.
Answer : C
Explaination
A transaction is a single unit of work items which follows the ACID properties.
Q 9 - Which of the following is correct about a Failed attrribute of Bean Managed Transactions in EJB?
A - When to start a transaction in a business method.
B - Identify success scenario when a transaction is to be committed.
C - Identify failure scenario when a transaction is to be rollback.
Answer : C
Explaination
Failed - Identify failure scenario when a transaction is to be rollback.
Q 10 - What JNDI stands for?
A - Java Naming and Directory Interface
B - Joint Naming and Directory Interface
Answer : A
Explaination
JNDI stands for Java Naming and Directory Interface.