1.
What EJB Category Stores A Specific User’s Data For a Single Session?
Correct Answer
C. Session Bean
Explanation
Session Beans are used to store and manage data for a specific user's session. They are responsible for maintaining the state of a particular user's interaction with the application during a session. This makes them the appropriate choice for storing a specific user's data for a single session. Entity Beans are used to represent persistent data, while Message Driven Beans are used for asynchronous processing. Therefore, neither of these options would be suitable for storing a specific user's data for a single session.
2.
What Type of EJB Is Often Used To Run Independent Operations?
Correct Answer
C. Stateless EJB
Explanation
Stateless EJB is often used to run independent operations because it does not maintain any conversational state between method invocations. This means that each method invocation is independent and does not rely on any previous method invocations. Stateless EJBs are lightweight and can handle multiple client requests concurrently, making them suitable for running independent operations.
3.
Which of the Following is a Major Requirement When Running EJB?
Correct Answer
A. JDK
Explanation
When running EJB (Enterprise Java Beans), a major requirement is the JDK (Java Development Kit). The JDK is necessary because it provides the tools and libraries needed to develop and run Java applications, including EJBs. Without the JDK, it would not be possible to compile and execute the EJB code. Therefore, having the JDK installed is crucial for running EJB successfully.
4.
What EJB Category Acts as a Permanent Data Storage?
Correct Answer
A. Entity Bean
Explanation
Entity Beans in EJB act as a permanent data storage. They are used to represent persistent data in a database and provide a way to interact with the database through object-oriented programming. Entity Beans have a state that can be stored and retrieved from a database, making them suitable for long-term storage of data. The other options, Message Driven Bean and Session Bean, do not provide permanent storage capabilities and are used for different purposes in EJB.
5.
Which of the Following is Used by Java Based Applications for Directory Services and Naming?
Correct Answer
D. JNDI
Explanation
JNDI (Java Naming and Directory Interface) is used by Java-based applications for directory services and naming. It provides a way for applications to access and manipulate naming and directory services, such as LDAP (Lightweight Directory Access Protocol) or DNS (Domain Name System). JNDI allows Java applications to look up and bind to objects in a distributed environment, making it easier to locate and access resources like databases, messaging systems, and other services. It acts as a bridge between the application and the directory service, allowing for seamless integration and interoperability.
6.
Which of the Following is Not One of the ACID Properties?
Correct Answer
B. Conditional
Explanation
The ACID properties in database management systems stand for Atomicity, Consistency, Isolation, and Durability. These properties ensure that database transactions are reliable and maintain data integrity. Atomicity guarantees that a transaction is treated as a single unit of work, either all of its operations are executed or none. Consistency ensures that a transaction brings the database from one valid state to another. Isolation ensures that concurrent transactions do not interfere with each other. Durability guarantees that once a transaction is committed, its changes are permanent. Therefore, the correct answer is "Conditional" as it is not one of the ACID properties.
7.
What is the EJB Mechanism that Can Build a Scheduled Application?
Correct Answer
D. Timer Service
Explanation
The Timer Service in EJB is the mechanism that can be used to build a scheduled application. The Timer Service allows developers to schedule tasks to be executed at specific times or intervals. It provides a simple and reliable way to automate recurring tasks in an enterprise application. With the Timer Service, developers can create timers that trigger method invocations on EJB components, allowing them to perform scheduled operations such as sending notifications, generating reports, or updating data.
8.
Which of the Following Can be Used in EJB to Create Custom Queries Easily Without Worrying About Specific Details of the Database?
Correct Answer
B. EJBQL
Explanation
EJBQL can be used in EJB to create custom queries easily without worrying about specific details of the database. EJBQL is a query language specifically designed for EJB applications. It allows developers to write queries using object-oriented concepts and entity relationships, rather than directly dealing with the underlying database structure. This abstraction layer provided by EJBQL simplifies the process of creating queries and makes it easier to maintain and update the code in case of any changes in the database schema.
9.
What EJB Transaction Attribute Signify that the Business Method Will Run as Part of Transaction?
Correct Answer
D. SUPPORTS
Explanation
The EJB Transaction Attribute "SUPPORTS" signifies that the business method may run as part of a transaction, but it is not mandatory. It means that if a transaction is already in progress, the method will participate in that transaction. However, if no transaction exists, the method will still be executed outside of any transaction.
10.
In EJB, What Do You Call Exceptions that are Not Caused by Business Code or Business Logic?
Correct Answer
C. System Exception
Explanation
In EJB, exceptions that are not caused by business code or business logic are called System Exceptions. These exceptions are typically caused by system failures, such as network errors or database failures, and are not directly related to the business logic of the application. Application Exceptions, on the other hand, are exceptions that are caused by business logic and are explicitly declared in the application code. Non-Business Exception is not a recognized term in EJB.