Quizack experts have done their best by conducting research and real-time analysis for the sake of authentic Enterprise Java MCQ questions. Mesmerizing thing is, that you will be able to practice all the latest Quizzes via interactive online testing tools. Quizack online practice sessions Enterprise Java Beans - EJB Skill Assessment are restriction-free, so you are going to spend unlimited time browsing the questions, skipping questions, and viewing the answers.
2. The following method signature is found in an implemented entity bean named 'CustomerBean.' 'CustomerPK' is a class representing the primary key.
public CustomerPK ejbFindByPrimaryKey(CustomerPK key)
By context look up, a client gets the reference to the home object of the above bean, named 'custHome'. It gets the 'CustomerPK' class named 'PK' by a different method. The name of EJBObject is 'Customer', which represents a customer. Which of the following options will you select to invoke the above mentioned method in the client?
7. One of the methods of your entity bean retrieves the names of all the patients admitted in a particular ward of a hospital. Using a connection named 'con', you want to execute the following query:
//secId is the parameter received by the method
String query = "SELECT admissionId, patientFirstName, patientLastName FROM ADMISSION WHERE sectionId=" + secId;
Which of the following options will help you execute the query?
12. You are working with EJB2.0. You have to retrieve a previously saved handle to an EJBObject named 'bookEJBObject.' In order to restart the processing for that particular request, you need to get the remote interface. The following code has been written for the same:
1. ObjectInputStream stream =
2. new ObjectInputStream(new FileInputStream(fileName));
4. Handle bookHandle = (Handle) stream.readObject();
6. BookRemoteInterface bookEjbObject = (BookRemoteInterface) XX() ;
Which of the following should substitute Method XX() of line 6?
23. A heavy tool manufacturing company manages its business and production by using enterprise beans. A session bean named 'Status' is used to get the production status for the day. The following code gets the context:
Context initialContext = new InitialContext();
The bean provides a local client view. For the local home interface named 'StatusHome.' What should be the lookup?
25. An online shop employs a stateless session bean (named 'Eshop') to process the requests. 'Eshop' uses a declarative transaction management system. The following code is from the xml deployment descriptor file of the bean:
The session and transaction attributes are to be coded in the lines numbered 10 and 11. Which of the following options should be used to make the bean work as expected?
37. An online medical shop uses Container Managed persistent beans for its operations. An OrderBean uses a query to list all the orders where payable amount is more than $800. The XML query tag in the deployment descriptor is as follows:
If the name of the table is 'Order' and total amount payable is in the column named 'amount,' which of the following queries can be placed in line 6?
41. We are saving a handle to an EJBObject named 'bookEJBObject' for an online book shop:
1. javax.ejb.Handle bookHandle = _____________;
3. ObjectOutputStream stream =
4. new ObjectOutputStream(new FileOutputStream(fileName));
Which of the following methods should be filled in the blank?
Enterprise Java Bean (EJB) is a component architecture for the development and deployment of enterprise Java applications. Enterprise JavaBeans are built on top of the Java EE platform and provide a standard way to create reusable business logic components that can be deployed in any compliant Java EE application server.
A Java Bean is a reusable software component that can be manipulated visually in a builder tool. A developer creates a Java Bean by writing a class that conforms to certain conventions. Once the bean is written, it can be used in any number of ways and in any number of applications.
Message-driven beans (MDBs) are enterprise beans that handle messages asynchronously. They are similar to session and entity beans in that they are managed by the container, but they differ in several respects. First, message-driven beans do not have home and remote interfaces. Second, they use Java Message Service (JMS) rather than RMI for communication. Finally, message-driven beans are not transacted by default; that is, they do not participate in container-managed transactions unless explicitly configured to do so.
A session bean is a server-side component that represents a conversation with a client. It is used to manage the state of an interactive client session. Session beans can be either stateless or stateful.
A stateless session bean does not maintain a conversational state with the client. This means that a stateless session bean cannot remember anything about previous interactions with the client and, as a result, all invocations are treated independently. Because they do not maintain any state between method invocations, stateless session beans can service multiple clients concurrently.
A stateful session bean is a type of enterprise bean that maintains a state across multiple client invocations. That is, the bean instance's variables retain their values from one invocation to the next. A stateful session bean therefore can be thought of as a conversation between the enterprise bean and the client.
A singleton session bean is a type of enterprise bean that allows only one instance of the bean to be created per JVM. This means that all clients accessing the bean will share the same instance. A singleton session bean is used when you need to ensure that only one instance of the bean exists in the application. This can be useful for creating a cache of data that needs to be shared across all users of the application.
Entity beans are enterprise JavaBeans that represent persistent data in a database. Entity beans can be used to represent data in a relational database, an object-oriented database, or any other kind of data store. Entity beans are typically used to represent data that will be persisted in a database, such as customer information or product information.
Business logic is the code that implements the business rules of an application. It is usually written in the form of classes, with each class representing a specific business entity.
An EJB container is a server-side component that provides a runtime environment for enterprise beans. The container is responsible for managing the lifecycle of enterprise beans and providing services such as security, concurrency, transactions, and connectivity to external resources.
A Java Message Service (JMS) is a standard for accessing enterprise messaging systems. A JMS session provides a context in which message producers and consumers operate. It is analogous to a database connection or JDBC connection. A JMS provider typically implements a number of sessions, each with its own thread of control.
Quizack does not want to leave you with incomplete practice or preparation. That is why we pursue you to make your learning effective. You can check your knowledge in minutes by taking Enterprise Java Beans - EJB Quiz Online. This virtual session will test your knowledge by bringing in randomly selected questions.
Quizack experts are true professionals since they have produced this particular database after looking into ongoing practical techniques. This is why Quizack claims to help you best against any EJB exam, IT certification, EJB interview, or Pre-Employment assessment. Quizack has also prepared Enterprise Java Beans MCQ questions PDF.
This is another benchmark of Quizack that has made your learning quick and smart. Unlike others, you don’t have to stick with typical learning mediums. Indeed, you can practice Enterprise java viva questions via online sessions, Quizack App, or PDF files. Now, this inspiring approach makes our users promote our services to their friends via leading social media platforms.
Quizack subject matter experts have done thorough testing and validation. But still, experts are ready to listen to your suggestions. If you find discrepancies or anything missing, you can reach us via the contact us page.
Quizack rewards its contributors by maintaining their profiles among its top experts. If you have top skills, showcase them by contributing MCQs or anything like that. Your skills will be acknowledged by Quizack.