EJB/EJB MCQ QUESTIONS AND ANSWER Sample Test,Sample questions

Question:
	
Which of the following exceptions is thrown by the ejbLoad() method of an entity bean when the database row to be loaded is not found ?

1.NoSuchEntityException

2.EJBException

3.RemoteException

4.ObjectNotFoundException

Posted Date:-2024-02-07 12:19:03


Question:
	
Which of the following is true for EJB?

1.EJB is server-side component architecture for distributed applications in Java

2.EJB facilitates scalable, secure and transaction-oriented applications

3.EJB supports portability and reusability

4.All of the above.

Posted Date:-2024-02-07 12:21:05


Question:
	
Which part of multi-tier enterprise application contains EJB component?

1.Application Server

2.Web Server

3.Database Server

4.Fat Client

Posted Date:-2024-02-07 12:23:12


Question:
	
Which statement correctly identifies the goals of the designers of the EJB architecture?

1.The EJB architecture requires that users be aware of the low-level transaction details of the Java EE platform.

2.The EJB architecture is the standard component architecture for building distributed business applications in the Java programming language. (*)

3.Although the EJB architecture defines the contracts that enable tools to develop and deploy components, each application server vendor must produce its own set of additional tooling.

4.The EJB architecture provides a standard way of persisting state data using the Java Persistence API, Java Data Objects, and JDBC.

Posted Date:-2024-02-07 12:17:27


Question:
A message driven bean is like statefull session bean that encapsulates the business logic and doesn't maintain state.

1.True

2.False

3.none

4.all

Posted Date:-2024-02-07 12:38:03


Question:
EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence.

1.True

2.False

3.none

4.all

Posted Date:-2024-02-07 12:38:25


Question:
EJB system’s performance tuning is the responsibility of

1.Bean Provider

2.EJB Deployer

3.Application Assembler

4.Tool Vendor

Posted Date:-2024-02-07 12:36:53


Question:
The EJB Transaction Attribute that ensures the method call that always takes place in a transaction, either client started or container started’ are

1.TX_SUPPORTS

2.TX_MANDATORY

3.TX_REQUIRED and TX_REQUIRES_NEW

4.Either A or B

Posted Date:-2024-02-07 12:37:20


Question:
Upon invoking getRollbackOnly() method by a business method in an entity bean, which transaction attribute settings will lead the ejb container to throw an exception?

1.Required

2.RequiresNew

3.Never

4.Mandatory

Posted Date:-2024-02-07 12:35:36


Question:
When a session bean has container-managed demarcation value of 'Supports', which three methods run in an unspecified transaction context? 1. ejbActivate 2. getRollbackOnly 3. getUserTransaction 4. ejbRemove 5. afterBegin 6. afterCompletion

1.1,4,3

2.4,2,6

3.1,4,6

4.2,5,6

Posted Date:-2024-02-07 12:36:32


Question:
Which EJB uses EJB-QL for query operations?

1.BMP Entity Bean

2.CMP Entity Bean

3.Session Bean

4.Message-Driven Bean

Posted Date:-2024-02-07 12:31:41


Question:
Which EJB usually represents persistent data?

1.Entity Bean

2.Stateless Session Bean

3.Stateful Session Bean

4.Message-Driven Bean

Posted Date:-2024-02-07 12:29:27


Question:
Which interface should be implemented by a stateful session bean if it needs to synchronize its conversational state with the transactional context?

1. javax.transaction.UserTransaction

2. javax.ejb.SessionSynchronization

3.javax.ejb.EJBContext

4. javax.transaction.TransactionContext

Posted Date:-2024-02-07 12:18:41


Question:
Which is least visibility scope for Java bean in JSP?

1.Page

2.Session

3.Request

4.Application

Posted Date:-2024-02-07 12:29:53


Question:
Which is not a valid scope for Java bean in JSP?

1.Page

2.Session

3.Request

4.Global

Posted Date:-2024-02-07 12:33:15


Question:
Which is the method available in SessionContext interface?

1.afterBegin()

2.getRollbackOnly()

3.setSessionCotext()

4.getUserTransaction()

Posted Date:-2024-02-07 12:34:53


Question:
Which JSP tag is used to transfer processing to another JSP page?

1.<jsp:include>

2.<jsp:forward>

3.<jsp:redirect>

4.<jsp:useBean>

Posted Date:-2024-02-07 12:28:12


Question:
Which method of the request object is used to extract values of the input fields in a form when it is submitted?

1.getParameter

2.getParameterNames

3.getValues

4.putValues

Posted Date:-2024-02-07 12:30:54


Question:
Which of the EJB has a passive state in its life cycle? I. Stateless Session Bean. II. Message-Driven Bean. III. BMP Entity Bean.

1.Only (I) above

2.Only (II) above

3.Only (III) above

4.Both (I) and (II) above

Posted Date:-2024-02-07 12:22:27


Question:
Which of the following can be directly invoked by the client?

1.ejbPassivate

2.business methods

3.setSessionContext

4.newInstance

Posted Date:-2024-02-07 12:34:32


Question:
Which of the following distributed object technology is/are not included in Java? I. CORBA. II. DCOM. III. RMI. IV. EJB.

1.Only (I) above

2.Only (II) above

3.Only (III) above

4.Only (IV) above

Posted Date:-2024-02-07 12:25:46


Question:
Which of the following EJB has no state? i. Message-Driven Bean. ii. BMP Entity Bean. iii. Stateless Session Bean. iv. Stateful Session Bean.

1. Both (I) and (II) above

2. Both (II) and (III) above

3.Both (III) and (IV) above

4. Both (I) and (III) above.

Posted Date:-2024-02-07 12:20:39


Question:
Which of the following EJB type has no Remote interfaces?

1.Message-Driven Bean

2.BMP Entity Bean

3.CMP Entity Bean

4.none

Posted Date:-2024-02-07 12:21:31


Question:
Which of the following is an approach for state maintenance in Web applications?

1.Hidden Form Field

2.URL Rewriting

3.Cookies

4.All of the above.

Posted Date:-2024-02-07 12:28:37


Question:
Which of the following is not a container for EJB? I. Internet Information Server. II. Java System Application Server. III. Tomcat. IV. WebLogic.

1.Both (I) and (II) above

2.Both (II) and (III) above

3.Both (III) and (IV) above

4.Both (I) and (III) above.

Posted Date:-2024-02-07 12:29:06


Question:
Which of the following is not a property of EJB transaction?

1.Atomicity

2.Consistency

3.Isolation

4.Distributed

Posted Date:-2024-02-07 12:26:08


Question:
Which of the following is not an implicit object in JSP? I. Request. II. Session. III. Vector. IV. In.

1.Both (I) and (II) above

2.Both (II) and (III) above

3.Both (I) and (III) above

4.Both (III) and (IV) above.

Posted Date:-2024-02-07 12:32:48


Question:
Which of the following is not true for <jsp:useBean> tag in JSP page?

1.Locates a bean instance

2.Stores object reference of the bean in a variable

3.Creates an instance if fails to locate the bean instance

4.All the above.

Posted Date:-2024-02-07 12:32:24


Question:
Which of the following is not true for servlet?

1.It is persistent

2.Platform independent

3.High performance

4.It is single threaded.

Posted Date:-2024-02-07 12:26:42


Question:
Which of the following is the format for EJB deployment descriptor files?

1.XML

2.XSL

3.HTML

4.Java

Posted Date:-2024-02-07 12:19:29


Question:
Which of the following is true for CORBA?

1.Protocol for distributed computing

2.Database specification

3.Specification for distributed objects

4.Both (c) and (d) above.

Posted Date:-2024-02-07 12:31:18


Question:
Which of the following is true for Java Bean?

1.It can not be a GUI component

2.It never implements serializable interface

3.It has zero-argument constructor

4.It is a distributed component

Posted Date:-2024-02-07 12:32:03


Question:
Which of the following is true for JNDI?

1.Database service

2.Naming and Directory Service

3.Network Service

4.Web Service

Posted Date:-2024-02-07 12:30:33


Question:
Which of the following is/are true for JSP technology? I. It is persistent. II. Platform independent. III. Browser executes the code.

1.Only (I) above

2.Only (II) above

3.Both (I) and (II) above

4.Both (II) and (III) above

Posted Date:-2024-02-07 12:30:12


Question:
Which of the following types of Enterprise Java Bean will be most likely to be difficult to port from one App Server to another?

1.Stateful Session Beans

2.Stateless Session Bean

3.BMP (Bean Managed Persistence) Entity Bean

4.CMP (Container Managed Persistence) Entity Bean

Posted Date:-2024-02-07 12:18:18


Question:
Which role in EJB architecture is responsible for EJB Server?

1.EJB Deployer

2.Application Assembler

3.Network Engineer

4.Server Provider

Posted Date:-2024-02-07 12:22:00


Question:
Which statement about life-cycle callback methods is correct?

1. Life-cycle callback methods must be implemented in the bean class.

2.Life-cycle callback methods can have public, private, protected, or packagelevel access. (*)

3. A life-cycle callback method can only have a single callback annotation. In other words, you cannot define a single method and give it two different callback annotations.

4. Life-cycle callback methods can be declared as static.

Posted Date:-2024-02-07 12:17:54


Question:
Which statements about a session bean class are true?

1.It is a final class

2.Overloaded constructors are supported

3.Their business methods can be 'private'

4.The ejbCreate() method must not be a final method

Posted Date:-2024-02-07 12:35:14


Question:
Which two of the following is responsible to creates ejb-jar files? 1. The bean provider. 2. The application assembler. 3. The deployer. 4. The system administrator.

1.1 and 2

2.2 and 3

3.3 and 4

4.4 and 1

Posted Date:-2024-02-07 12:33:37


Question:
Which two of the following must be included in every ejb-jar file? 1. Stubs for the EJBHome and EJBObject interface. 2. The JAR Manifest file. 3. A deployment descriptor. 4. The JNDI context. 5. The EJB's home interface.

1.1 and 3

2.2 and 5

3.3 and 5

4.4 and 2

Posted Date:-2024-02-07 12:34:01


More MCQS

  1. EJB Core Java Mcq Questions
  2. EJB MCQ - Java Technologies
  3. EJB MCQ QUESTIONS AND ANSWER
  4. Advanced EJB MCQ QUESTION AND ANSWER
  5. EJB MCQ QUESTIONS AND ANSWER
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!