Free Cheat-test Samples and Demo Questions Download
Adobe exams Adobe
Apple exams Apple
Avaya exams Avaya
Check Point exams Check Point
Cisco exams Cisco
Citrix exams Citrix
CIW exams CIW
CompTIA exams CompTIA
EC-Council exams EC-Council
EMC exams EMC
Exin exams Exin
Fortinet exams Fortinet
Hitachi exams Hitachi
HP exams HP
IBM exams IBM
Isaca exams Isaca
ISC exams ISC
Juniper exams Juniper
LPI exams LPI
McAfee exams McAfee
Microsoft exams Microsoft
Oracle exams Oracle
PMI exams PMI
Riverbed exams Riverbed
SNIA exams SAP
Sun exams SAS
Symantec exams Symantec
VMware exams VMware
All certification exams

IBM 000-287 Exam -

Free 000-287 Sample Questions:

1.The following code fragment shows the creation of a session object within a servlet (request is an object of type HttpServletRequest, flag is a boolean value):
HttpSession session = request.getSession(flag);
Which of the following statements are TRUE after this line of code has been executed?
A:If flag is true, session always contains a reference to a new HttpSession object.
B:If flag is true and no HttpSession object currently exists for this client, session contains a reference to a new HttpSession object.
C:If flag is false and no HttpSession object currently exists for this client, session is null.
D:If flag is false and no HttpSession object currently exists for this client, an exception is thrown.
E:If flag is false, a new HttpSession object cannot be created because the session manager's maximum limits have been reached.
Answer: B, C

2.In order to successfully invoke a business method on an EJB that is only available via a Remote interface, a client MUST perform a number of discrete operations. What is the correct sequence of the following operations when connecting to the EJB via its remote interface?
I. Use the narrow method on the javax.rmi.PortableRemoteObject class
II. Create a javax.naming.InitialContext object
III. Perform a lookup on a javax.naming.Context object (locating the Home Interface)
IV. Invoke either a create or finder on the Home Interface
Answer: B

3.If a datasource with JNDI name "jdbc/MyDatasource" has been defined to use the DB2 driver "", what is a valid way to obtain a connection from the "jdbc/MyDatasource" connection pool? Assume that any generated exceptions appear in the throws clause of the method containing the code.
A: Datasource ds = new Datasource("jdbc/MyDatasource"); Connection conn = ds.getConnection("userid", "PASSWORD");
B: Class.forName(""); Connection conn = DriverManager.getConnection("jdbc:db2:MyDatasource", "userid", "PASSWORD");
C: Context context = new InitialContext(); DataSource ds = (DataSource)PortableRemoteObject.narrow(context.lookup("jdbc/MyDatasource"), DataSource.class); Connection conn = ds.getConnection("userid", "PASSWORD");
D: Context context = new InitialContext(); DataSource ds = (DataSource)PortableRemoteObject.narrow(context.lookup("jdbc/MyDatasource")); Connection conn = ds.getConnection("userid", "PASSWORD");
Answer: C

4.The enterprise application is used by students accessing it over the internet and by employees accessing it from the intranet. The business process steps are mapped to stateless session bean methods. The session beans MUST have a remote interface when they:
A:are accessed from different JVMs
B:are accessed by servlets
C:are accessed by non-Java clients
D:become part of the session bean pool
Answer: A, C

5.The Account entity EJB only exposes a local interface. A developer wants to create an access bean to help support Account object updates. Which is the BEST type of access bean for the developer to create using WebSphere Studio to meet this goal?
A: Java bean wrapper
B: Row set
C: Data class
D: Copy helper
Answer: C

6.Which of the following statements are TRUE for EJB Query Language (QL) as defined by the EJB 2.0 specification?
A:EJB QL queries can be used with BMP entity beans.
B:EJB QL applies to CMP entity beans only.
C:The ejbSelect method can return local EJB objects.
D:The entity beans must provide a local interface.
Answer: B, C

7.A developer of a self-service payroll application needs to connect to the payroll database. The name of the database is different in each of the development, staging and production environments. If the developer has to make the code portable across each of the environments, what is the BEST way to implement this?
A: Create a property file for each of the environments and define a property called "payroll_db" which maps to the physical database. For each of the environments, publish the environment specific property file. In the application code use this property to connect to the database.
B: Declare a resource reference called "payroll_db" in the deployment descriptor. While deploying the application in WebSphere, bind the resource to a JDBC Connection factory in the target environment. In the application code use the resource reference to retrieve a connection from the factory.
C: Define a Web Application context parameter called "payroll_db". While deploying the application in WebSphere, initialize this property with the name of the physical database in the target environment. In the application code use the Servlet API to lookup the value of the database and connect to it.
D: Define an environment variable for the database name. Make the code choose a database name based on the environment variable.
Answer: B

8.After creating a message-driven bean (MDB) in a new workspace, a developer codes the business logic for the bean. How can the developer proceed to test the function of the MDB? (Assume server configuration is correct and server has started.)
A: Select the MDB and from it's context menu select Run on Server.
B: Use the EJB test client to call the onMessage method of the bean.
C: Use the EJB test client to place a message on the listener port for the MDB.
D: Develop a Java Client application that uses JMS to place a message on the MDB's destination.
Answer: D

9.Refer to the exhibit to answer the question. Assuming container-managed transaction demarcation, which statement is FALSE concerning transactions and AccountBean?
A: An invocation of AccountBean.deposit() outside a transaction will result in a new transaction being created.
B: An invocation of AccountBean.getBalance() inside a transaction will not result in an Exception.
C: AccountBean.deposit() can execute outside any transaction scope.
D: AccountBean.getBalance() can execute outside any transaction scope.
Answer: A

10.While designing EJBs with WebSphere Studio V5 a developer decides that EJB inheritance would speed up the development of the enterprise beans. When subclassing the enterprise bean class which of the following rules MUST be obeyed?
A:Define the inheritance according to EJB 2.0 specification
B:Beans have to be defined in the same EJB module
C:Use EJB inheritance only with CMP entity beans
D:Subclassed beans share the parents primary key class
Answer: B, D

© 2014, All Rights Reserved