17. A JMS session can implement:
A. the QueueSession interface to support the publish-subscribe model.
B. the TopicSession interface to support the publish-subscribe model.
C. the QueueSession interface to support the point-to-point model.
D. the TopicSession interface to support the point-to-point model.
B, C (Monson Haenfel, S. 373)
18.When comparing servlets and JSPs, which of the following are FALSE?
A. JSPs provide better performance than servlets.
B. JSPs may call servlets and vice-versa.
C. A JSP must be compiled into a servlet before it can be used.
D. Initialization and destruction behavior is supported in both servlets and JSPs.
E. At runtime, JSPs and Servlets must run in different containers.
19. The executeUpdate() method of a java.sql.Statement and its derivates has a return-type. Select the correct return type and its meaning from the answers below.
A. The executeUpdate() method returns a ResultSet, that will contain all items of a query. The ResultSet will be if the query returned no items.
B. The executeUpdate() method returns a ResultSet, that will contain all items of a query. The ResultSet will be empty (contain no elements) if the query returned no items.
C. The executeUpdate() method returns an int, indicating the number of records that were changed. If the integer returned is negative, an error occurred.
D. The executeUpdate() method returns an int, indicating the number of records that were changed. If the integer returned is zero, no rows will have been updated or the change to the database was a DDL operation.
D (sicher, habe mich in API versichert).
20. An EJB is required to process credit card purchases. All purchase-related information such as card number and amount will be supplied as parameters to a single business method invocation that processes the purchase. Server performance is critical. Which bean type BEST suits the requirement?
A. A stateless session bean
B. A stateful session bean
C. A BMP entity bean
D. A CMP entity bean
E. A message-driven bean
21. Which of the following MUST be declared for a CMP entity bean in its deployment descriptor if it appears as a CMR field for some other entity bean?
A. bean class.
B. database connection factory reference.
C. home and remote interfaces.
D. local home and local interfaces.
E. primary key class.
A, C, E
22. servlet counts the number of times it has been called using an "synchronized void incrementCount()" method. During testing, the developer verifies that the servlet accurately counts the requests from a number of clients. Which of the following BEST explains this fact?
A. The Web container supports activation and passivation of the servlet.
B. The HttpServlet class is designed to share state data across all its instances.
C. The same servlet instance services all the requests.
D. The servlet doGet( ) method has been marked as synchronized.
23. Which of the following method declarations would MOST likely be found in the remote home interface of the entity bean named Customer?
A. Customer create() throws CreateException, RemoteException;
B. Customer createWithSSN(int id, String socialSecurityNumber) throws CreateException, RemoteException;
C. Customer findAllByAge(int age) throws FinderException, RemoteException;
D. Collection findAllByAge(int age) throws FinderException, RemoteException;
B und nicht A: Create ohne Parameter finde ich seltsam (kein Primary Key).
D und nicht C: Age ist kein Primary Key
24. When working with JAXP to perform XSLT, the method newTemplates(Source) on class TransformerFactory produces what kind of artifact?
A. An optimized representation of the XML source document to be transformed.
B. An optimized representation of the transformation instructions (i.e. stylesheet).
C. A concrete Transformer class that matches the source specification.
D. A collection of transformation objects.
C, ziemlich sicher.
25. JAAS CallbackHandlers are used by what object?
HÖLLE. Tendiere zu C.
26. Consider the following snippet from a web.xml file:
Assuming that com.bigbank.ConnectionManager class implements ServletContextListener interface, and com.bigbank.SessionTracker implements HttpSessionListener interface, which of the following is a valid sequence of events that occur in time?
(stimmen die Methoden). A sieht merkwürdig aus.
C.2/3 sind Methoden aus SessionActivationListener Interface
27. A CMP entity bean implements a BankAccount record. The bean requires a composite primary key consisting of a branch number and an account number. Both values are of type int. The class AccountKey has been created to hold these values. Which of the following declarations of ejbCreate() would be valid ways to create a BankAccount bean, given that neither field can be automatically generated ?
B. ejbCreate(int branchNumber)
C. ejbCreate(int accountNumber)
D. ejbCreate(int branchNumber, int accountNumber)
E. ejbCreate(AccountKey key)
Halte ich erst einmal für offensichtlich
28. In which of the following scenarios should a developer choose an applet instead of a servlet for the application presentation?
A. A text lookup tool, where the user enters a search string and matching entries are displayed.
B. A financial spreadsheet, where dollar amounts can be interactively tabulated and graphed.
C. A three-dimension multi-player video game, where players run around in a maze and try to pick roses before they are all gone.
D. A zip code finder, where the user enters a street address and gets the zip code as well as the location address on a map.
29. Which of the following is NOT a required step to get a reference to an existing EJB's home?
A. Get a remote reference to the EJB home by using the JNDI Context lookup() method, passing the name of the EJB's home.
B. Use the RMIRegistry lookup() method to get a remote reference to the EJB home.
C. Cast the EJB home remote reference to the right type by using the PortableRemoteObject.narrow() static method, passing the remote reference and the class of the EJB home.
D. Cast the remote object reference to the right type within Java.
A statt D.
30 Which object CANNOT be retrieved from a JNDI namespace by an Application Client?
A. EJBHome (stub)
B statt D.
31. Which of the following implicit page objects are available for a JSP page with an "isErrorPage=true" page directive?
A, C, D
32. What J2EE technology BEST provides the View layer of an MVC design pattern?
33. Which of the following are valid JNDI bindings under the java:comp context, as defined by the J2EE specification?
34. Which of the following is TRUE concerning CMP entity bean activation and passivation?
A. Storage of persistent state to the database is handled automatically by the EJB container during passivation.
B. A client must explicitly activate a bean that has been passivated.
C. Clients do not directly communicate with a bean and are unaware of activation and passivation.
D. Transient fields are handled explicitly by activation and passivation.
35. Which of the following steps will occur when an EJB container obtains a Connection from a XADataSource and prepares to use it?
A. The container will obtain the XAResource reference from the Connection.;
B. The connection pool will register itself as a XAResourceEventListener with the XAResource.
C. The transaction manager will invoke the begin() method on the XAResource.
D. The transaction manager will invoke the start() method on the XAResource.
(nicht wirklich sicher)
(Monson Haenfel, S. 421 ff.)
Vermutlich B nicht A
C auf jedenfall, nicht D
36. Which is the BEST of the following designs to leverage the J2EE architecture?
A. Clients install Swing components on their system which interact via RMI with EJBs on the server, EJBs interact with backend services such as databases.
B. Clients view applets in Web browsers, servlets service the client requests on the server and interact with backend services such as databases.
C. Clients view HTML in Web browsers, JSP pages service the client requests and request services from EJBs on the server, EJBs interact with backend services such as databases.
D. Clients view HTML in Web browsers, CGI scripts service the client requests on the server and request services from EJBs on the server, EJBs interact with backend services such as databases.
D  keine CGI scripts.
C  Servlets und JSP request services from EJB.
A  Swing komponents interagieren nicht via RMI sondern über client Container???