- 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 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 entity bean?
A - User data can be saved to database via entity beans.
B - User data can be retrived from the database in the entity bean.
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 is true about stateless bean?
Answer : C
Explaination
EJB Container normally creates a pool of few stateless bean's objects and use these objects to process client's request. Because of pool, instance variable values are not guaranteed to be same across lookups/method calls.
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 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 - @javax.ejb.ActivationConfigProperty 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 @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 annotation is used to inject an ejb into another ejb?
Answer : A
Explaination
@EJB annotation is used to inject other EJB reference.
Q 8 - What ACID stands for?
A - Atomic, Consistent,Isolated and Durable
B - Acurate, Correct,Isolated and Durable
Answer : A
Explaination
ACID stands for Atomic, Consistent,Isolated and Durable.
Q 9 - Which of the following is correct about a REQUIRED attrribute of Container Managed Transactions in EJB?
B - Indicates that a new transaction is to be started for the business method.
C - Indicates that business method will execute as part of transaction.
D - Indicates that business method should not be executed as part of transaction.
Answer : A
Explaination
REQUIRED - Indicates that business method has to be executed within transaction otherwise a new transaction will be started for that method.
Q 10 - Which of the following is correct about a RolesAllowed attrribute of Container Managed Transactions in EJB?
A - Indicates that class will accept those declared roles. Annotations are applied at class level.
Answer : B
Explaination
RolesAllowed - Indicates that a method can be accessed by user of role specified. Can be applied at class level resulting which all methods of class can be accessed buy user of role specified.