Test: IBM Enterprise Connectivity Exam #484

Posted on
Share on Google+Share on LinkedInShare on FacebookShare on RedditTweet about this on TwitterEmail this to someone

Whizlabs, a global leader in J2EE certification preparation, has recently launched the Exam Simulator for IBM Test #484 certification exam. The following quiz is an excerpt from Whizlabs Exam Simulator. For a detailed version, please visit www.whizlabs.com/j2ee/j2ee.html.

Questions:

1. Which of the following statements are true?

A. A servlet client can obtain a UserTransaction object using JNDI.
B. The lookup method of InitialContext takes the bean’s JNDI name as the argument.
C. Handles or home handles are used by local as well as remote clients.
D. Local clients use EJBMetaData to get information about the bean class.

2. You have Java developers and Web page designers (without Java knowledge) working on your JSPs. Which is the best way to organize the work?

A. Developers can work on scriptlet code, and designers can embed formatting code.
B. Designers can work on custom JSP tags, developed by the Java developers.
C. Designers can use JavaBean components, developed by the Java developers.
D. Designers can use EJB components, developed by the Java developers.

3. In an enterprise application, a user submits feedback on a product at a corporate Web site. Which of the following is the best way to structure the application?

A. A servlet receives the HTTP request, produces a message with the destination of a JMS provider and forwards the HTTP request to a JSP, which shows the thank-you information to the user.
B. A servlet receives the HTTP request, performs the feedback processing in the servlet method and writes the thank-you information to the user as HTML.
C. A JSP receives the HTTP request, uses a session EJB to process the feedback and uses the results to generate the thank you page to send back to the user.
D. A JSP receives the HTTP request, uses a JavaBean to process the feedback and forwards the request to a servlet to thank you message to the response as HTML.

4. When a servlet receives an HTTP request, it needs to identify which operation is being requested by the client. What is the best way to indicate this to the server?

A. Using hidden form fields
B. Using a URL query string parameter
C. Using a servlet mappings
D. Using cookies

5. Which of the following statements are true about JAAS?

A. A subject may contain multiple principals.
B. CallbackHandlers are used for authorization.
C. The LoginContext instantiates LoginModules.
D. Authentication is not a prerequisite for authorization.

6. Whose responsibility is it to provide an implementation of the home interface of an EJB?

A. Container and its tools
B. Deployer
C. Application assembler
D. Bean provider

7. Which of the following exceptions can be thrown from the service method of a servlet?

A. Any exception wrapped as ServletException
B. IOException
C. RuntimeException
D. All of the above

8. Which of the following needs to be done by the application programmer when using pooled JDBC connections?

A. Use a DriverManager class to get the connection
B. Use a DataSource object to get the connection
C. Close the connection in a finally block
D. Use a ConnectionPoolDataSource object to get the connection

9. When a Web module depends on an EJB module, what is the BEST way for a Web module to reference the EJB interfaces and client stubs?

A. Package the EJB interfaces and client stubs into a separate EJB Client JAR file and specify this JAR file in the MANIFEST Class-path of the Web module.
B. Specify the EJB JAR file in the MANIFEST Class-path of the Web module.
C. Package the EJB interfaces and client stubs into the Web module.
D. Package the EJB and Web modules into an EAR file and specify EJB jar in the Class-path property of the EAR deployment descriptor.

10. A Web application requires the logic for validating form input and determining the next view to display. Which design is BEST to implement this logic?

A. Validation and view dispatching code can be handled by servlets
B. Validation and view dispatching can be handled by JSP
C. Validation logic can be in servlets and view dispatching code in JSP
D. Validation logic can be in JSP and view dispatching code in servlets

11. The Templates object represents a _______.

A. Compiled style sheet instance
B. XML source document to be transformed
C. A Transformer
D. A collection of Transformer instances

12. Which of the following show the correct sequence in the lifecycle of an entity bean?

A. ejbCreate, ejbPostCreate, setEntityContext
B. newInstance, setEntityContext, ejbCreate
C. setEntityContext, ejbCreate, ejbActivate
D. ejbCreate, ejbPostCreate, ejbActivate

13. Which of the following is the correct code by an EJB to use to lookup a JDBC datasource?

A. InitialContext jndiContext = new InitialContext(); DataSource source = (DataSource)jndiContext.lookup(“java:comp/env/jdbc/myDB”);
B. InitialContext jndiContext = new InitialContext(); DataSource source = (DataSource) jndiContext.lookup(“jdbc/myDB”);
C. InitialContext jndiContext = new InitialContext(); DataSource source = (DataSource) jndiContext.lookup(“myDB”);
D. InitialContext jndiContext = new InitialContext(); DataSource source = (DataSource) jndiContext.lookup(“java:comp/jdbc/myDB”);

14. Which of the following statements are true about filters?

A. Filters cannot service multiple requests simultaneously.
B. There is only one instance of the Java class defining the filter per declaration.
C. Filters can act on dynamic as well as static content.
D. Filters can be used to transform the response from a JSP page.
E. Filters are typically used to create response.

15. A transactional client receives TransactionRolledBackException from a call to a method on an entity bean. What could be the possible reasons for this?

A. The bean method is throwing a checked exception and is configured with a transaction attribute of “Required.”
B. The bean method is throwing an unchecked exception and is configured with a transaction attribute of “Required.”
C. The bean does not throw an exception but is configured with a transaction attribute of “Mandatory.”
D. The bean method is throwing an unchecked exception and is configured with a transaction attribute of “Requires New.”

16. Which of the following statements are true about MDB?

A. They support instance pooling.
B. They are subject to activation and passivation.
C. A call to the remove() method on the bean’s home object is delegated to the ejbRemove() method of the MDB.
D. The setMessageDrivenContext() is invoked on the bean by the container, after instantiating it.

17. Which of the following is required for a CMP entity bean if it is a CMR field for some other entity bean?

A. A local component interface
B. A remote component interface
C. Both local and remote component interfaces
D. None of these

18. The remote home interface of CustomerEJB defines a findByCity method that returns a java.util.Collection of Customer objects. Which of the following statements are true?

A. Each element is a HomeHandle object.
B. Each element is a Handle object.
C. Each element is an EJB Object.
D. Each element needs to be type narrowed before use.
E. Each element can be cast to the right type using simple Java casting.

19. Which of the following statements are true about the Transfer Object pattern?

A. It reduces the coupling between the business tier and the integration tier.
B. It ensures that none of the clients receive stale data.
C. It reduces network traffic.
D. It simplifies the remote interfaces of business objects.

20. To obtain a JDBC connection reference in the EJB code, which

Share on Google+Share on LinkedInShare on FacebookShare on RedditTweet about this on TwitterEmail this to someone
cmadmin

ABOUT THE AUTHOR

Posted in Archive|

Comment:

Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>