Top 150+ Solved Enterprise Computing With JAVA MCQ Questions Answer
Q. Which statement is correct about the EntityManager API?
a. The merge, persist, remove, and getReference methods must be invoked within a transaction context.
b. It is safe (no exception is thrown) to call merge or getTransaction on a JTA EntityManager instance.
c. The getReference method can throw an EntityNotFoundException.
d. Runtime exceptions thrown by the refresh and createQuery methods of the EntityManager interface do NOT cause the transaction to be rolled back.
Q. Which statement about JTA and resource-local entity managers is correct?
a. The default transaction type for an entity manager is JTA in both Java EE and Java SE environments.
b. You cannot use a resource-local entity manager in a Java EE environment.
c. The EntityTransaction interface must be used when using a resource-local entity manager. (*)
d. Application-managed entity managers can be only a JTA transaction type.
Q. Which of the following is not a container for EJB? I. Internet Information Server. II. Java System Application Server. III. Tomcat. IV. WebLogic.
a. Both (I) and (II) above
b. Both (II) and (III) above
c. Both (III) and (IV) above
d. Both (I) and (III) above.
Q. Which of the following is/are true for JSP technology? I. It is persistent. II. Platform independent. III. Browser executes the code.
a. Only (I) above
b. Only (II) above
c. Both (I) and (II) above
d. Both (II) and (III) above
Q. Which method of the request object is used to extract values of the input fields in a form when it is submitted?
a. getParameter
b. getParameterNames
c. getValues
d. putValues
Q. Which method of the servlet is/are called several times in its life?
a. init()
b. doPost()
c. destroy()
d. Both (a) and (b) above
Q. Which object is used to forward the request processing from one servlet to another?
a. ServeltContext
b. ServletConfig
c. RequestDispatcher
d. ResponseDispatcher
Q. Which of the following allows substitution of code to occur at the translation time in a JSP page?
a. <jsp:include> Tag
b. <@ include> directive
c. <@ page> directive
d. Declaration block
Q. Which of the following property of Java Bean represents a single value?
a. Simple property
b. Boolean property
c. Indexed property
d. Both (a) and (b) above
Q. Which of the following is used to redirect the response from a servlet to a JSP page?
a. response.sendRedirect()
b. request.sendRedirect()
c. request.forward()
d. response.forward()
Q. Which of the following is not true for <jsp:useBean> tag in JSP page?
a. Locates a bean instance
b. Stores object reference of the bean in a variable
c. Creates an instance if fails to locate the bean instance
d. Does not execute the body tag if any
Q. Which of the following is not an implicit object in JSP? I. Request. II. Session. III. Vector. IV. In.
a. Both (I) and (II) above
b. Both (II) and (III) above
c. Both (I) and (III) above
d. Both (III) and (IV) above.
Q. Which of the following are guaranteed capabilities of EJB 2.0?
a. Run-as security identity functionality.
b. The extension of JDBC 2.0
c. Both A and B
d. Neither A nor B
Q. From the following APIs, which API does NOT guarantee to be supported by EJB 2.0 containers?
a. JAXP
b. JNDI
c. JXTA
d. JDBC
Q. Which component does the Entity bean represent the persistent data stored in the database?
a. Server-side component
b. Client-side component
c. server and client side component
d. None of the above