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-154 Exam -

Free 000-154 Sample Questions:

1.EJB clients must supply which two of the following pieces of information in order to use JNDI services?
A.The IP address of a Web container
B.The DataSource name for a JDBC database
C.A provider URL detailing the location of the name tree
D.The class name of the initial context factory
Answer: C, D

2.When the JMS API is used, which two subtypes of javax.jms.Message are most appropriate for sending a message to a consumer that is not a Java client?
Answer: A, E

3.In the JMS API for the publish­subscribe domain, how does a durable subscriber differ from a non­durable subscriber?
A.Messages in topics that have durable subscribers remain in the topic until they expire or the subscriber connection to the JMS provider is closed.
B.If a durable subscriber becomes disconnected without unsubscribing and later reconnects, the subscriber receives messages that arrived while the subscriber was not active.
C.If a topic has a durable subscriber, the JMS provider logs all messages in a persistent media so that an application can inspect the log and extract messages at a later time.
D.The application server delivers each message in a transactional context so that if a durable subscriber then rolls back the transaction, the state of the message reverts to that prior to delivery.
Answer: B

4.Which of the following is NOT a message transfer protocol?
Answer: D

5.Which two of the following are NOT parts of the J2C Version 1.0 Common Client Interface?
D.TransactionFactory E.ResultSet
Answer: B, D

6.What is best method for obtaining a home interface for a bean named Employee?
A.Context initCtx = new InitialContext(System.getProperties()); Object o = initCtx.lookup("EmployeeHome"); EmployeeHome empHome = (EmployeeHome) javax.rmi.PortableRemoteObject.narrow(o, EmployeeHome.class);
B.Context initCtx = InitialContext.getDefaultContext(); Object o = initCtx.lookup("EmployeeHome");
EmployeeHome empHome = (EmployeeHome) javax.rmi.PortableRemoteObject.narrow(o, EmployeeHome.class);
C.Context initCtx = new InitialContext(System.getProperties()); EmployeeHome empHome = (EmployeeHome) initCtx.lookup("EmployeeHome");
D.Context initCtx = InitialContext.getDefaultContext(); EmployeeHome empHome = (EmployeeHome)
Answer: A

7.Given a JDBC data source named myDataSource, which of the following establishes a JDBC connection?
A.Connection con = new Connection(myDataSource);
B.Connection con = myDataSource.getConnection();
C.Connection con = ConnectionManager.getConnection(myDataSource);
D.Connection con =;
Answer: B

8.When a context throws a NamingException, which of the following methods can be used to determine which portion of the JNDI name is valid?
Answer: C

9.From the perspective of an EJB client, what types of EJBs will always be unique for every create() call?
B.Stateless Session
C.Stateful Session
Answer: A, C

10.Refer to the exhibit to answer the question. Consider the Employees relation defined in the exhibit and the Java code segment defined below: Statement s = con.createStatement(); ResultSet
rs = s.executeQuery("SELECT * FROM Employees " + "WHERE EmployeeID >= 10002 AND " + "EmployeeID <= 10004"); Which code segments display the entire content of the result set assuming that columns EmployeeID and Extension are of SQL type SMALLINT and column Name
is of SQL type VARCHAR? { System.out.println(rs.getShort("EmployeeID")); System.out.println(rs.getString("Name"));
System.out.println(rs.getShort("Extension")); } while ( { System.out.println(rs.getString("EmployeeID")); System.out.println(rs.getString("Name")); System.out.println(rs.getString("Extension")); } while (
C.while ( { System.out.println(rs.getString(1)); System.out.println(rs.getString(2)); System.out.println(rs.getString(3)); }
D.while ( { System.out.println(rs.getString(0)); System.out.println(rs.getString(1)); System.out.println(rs.getString(2)); }
E.while ( E.while ( E.while ( { System.out.println(rs.getString("EmployeeID")); System.out.println(rs.getString("Name")); System.out.println(rs.getString("Extension")); }
Answer: C, E

11.Refer to the exhibit to answer the question. Consider the Products relation defined in the exhibit. What is the result of attempting to execute the following Java code segment assuming con is a valid reference to an open Connection object? 1. PreparedStatement ps = con.prepareStatement( 2. "SELECT * FROM Products WHERE " + 3. "Cost < ?"); 4. 5. ps.setDouble(0, 10f); 6. 7. ResultSet rs = ps.executeUpdate(); 8.; 9. System.out.print(rs.getString(1)); 10. System.out.println(rs.getString(2));
A.The code segment displays "1001 Flyback Transformer".
B.The code segment displays "1004 Grounding Strap".
C.The code segment displays "Flyback Transformer 8.0".
D.The code segment displays "Grounding Strap 0.15".
E.No output is displayed due to a runtime error.
Answer: E

12.Which two of the following scenarios are better modeled in the JMS point­to­point domain than in the JMS publish­subscribe domain?
A.A store sends a shipping order to a warehouse to request delivery of a purchased item to a customer.
B.Headquarters of a chain of stores sends messages that contain price update information to several stores that consume messages independently.
C.Many sports teams post scores so that fans can see the latest results for their favorite teams.
D.A client application sends insurance policy data to an application that calculates insurance premiums, and waits for the response.
Answer: A, D

13.Where would an EJB reference be found if it were placed in the JNDI location recommended in J2EE 1.3?
Answer: A

14.Assuming variable env is a reference to a hashtable containing the parameters necessary to obtain the JNDI initial context, which of the following obtains a JDBC data source named MyDataSource?
A.DataSource ds; try { ctx = new InitialContext(env); ds = (DataSource) ctx.lookup("MyDataSource"); }
catch (NamingException ne) { }
B.DataSource ds; try { ctx = new InitialContext(env); ds = (DataSource)
ctx.getConnection("MyDataSource"); } catch (NamingException ne) { }
C.DataSource ds; try { ctx = new InitialContext(env); ds = (DataSource)
ctx.getNameInNamespace("MyDataSource"); } catch (NamingException ne) { }
D.DataSource ds; try { ctx = new InitialContext(env); ds = (DataSource)
ctx.getURLOrDefaultInitCtx("MyDataSource"); } catch (NamingException ne) { }
Answer: A

15.Consider an EJB named Employee and its home interface named EmployeeHome. The findByDepartment method of the EmployeeHome interface is most likely to have a return value of which of the following types?
Answer: D

16.A running Filter must call what method in order to ensure that the next filter in the filter chain is called?
Answer: B

17.A client has accessed a servlet via a form that uses an HTTP POST request. Which two methods could be used by the servlet to obtain information input within the form?
A.Using the servlet object's getServletInfo method
B.Using the request object's getAttribute method
C.Using the request object's getParameter method
D.Using the ServletConfig's getInitParameter method
E.Using the request object's getParameterValues method
F.Using the request object's getAttributeValues method
Answer: C, E

18.Which method would be used to call a registered servlet with the following attributes? Site = Web application name = testApp Servlet URI = TestServlet
A.getServletConfig().getServletContext().getRequestDispatcher(" ").forward(req,res); B.getServletConfig().getServletContext().getRequestDispatcher("/testApp/TestServlet").forward(req,res);
Answer: C

19.Which of the following is considered the best way to design a flexible API that does not require
a servlet per activity?
A.Embed the activity name in a hidden field. Let the servlet read the field to determine what must occur.
B.Create a query string containing the activity name as a parameter. Let the servlet read the parameter to determine what must occur.
C.Use a servlet mapping to make requests with the same suffix. Change the prefix to the action and let the servlet read the whole URL to determine what is required.
Answer: C

20.Which three of the following may be contained in a WAR file?
A.Enterprise JavaBeans
C.JavaServer Pages
E.Client­side Java applications
Answer: B, C, D

21.Which two of the following should be avoided in order for a servlet that does not implement the SingleThreadModel to be thread safe?
A.Class variables
B.Instance variables
C.Local variables
D.Class methods
E.Instance methods
Answer: A, B

22.Which two scenarios will always result in the init method of a servlet being invoked?
A.Every time a new client accesses the servlet
B.When the server automatically reloads the servlet
C.When an HTTP INIT type request is made by a client
D.When the servlet is put into service after loading and instantiation
Answer: B, D

23.For J2EE 1.3, which of the following session methods would allow the developer to set the timeout period so that a session will be automatically invalidated if it has not been used during the specified interval?
Answer: D

24.A client browser has cookies turned off and is interacting with a servlet that is using HTTP sessions for client state management. According to J2EE Patterns best practices, which technique or technology should be used by the servlet programmer in order to maintain this client's state?
A.Servlet filters
B.Servlet events
C.URL encoding
D.Use of persistent sessions
E.Creation of a new session at the beginning of the service method
F.Hidden fields G.Client­side certificates
Answer: C

25.Which would be the best exception to catch to ensure that all objects placed into a session in a clustered environment using Database­based session persistence properly implement Serializable where supported?
Answer: B

26.If four classes were instantiated in the following order, implementing the associated event listener, in what order would they be notified if the application were shut down? CustomConnectionManager implements HttpSessionListener CustomerManager implements ServletContextListener OrderManager implements HttpSessionListener ShoppingCartManager implements HttpSessionListener
A.ShoppingCartManager, OrderManager, CustomerConnectionManager, CustomerManager
B.ShoppingCartManager, CustomerManager, OrderManager, CustomConnectionManager
C.CustomerManager, ShoppingCartManager, OrderManager, CustomConnectionManager
D.CustomerManager, CustomConnectionManager, OrderManager, ShoppingCartManager
Answer: A

27.What method in the ServletContext could be used to get an attribute called times_Accessed from the servlet context?
A.getInitParameter(times_Accessed); B.getInitParameter("times_Accessed"); C.getParameter(times_Accessed); D.getParameter("times_Accessed"); E.getAttribute(times_Accessed); F.getAttribute("times_Accessed"); Answer: F
28.What is the best scope in which to store an object containing display data that is to be sent from a servlet acting as a controller to a JSP page with the session disabled?
Answer: B

29.A servlet has been configured in a deployment descriptor file with servlet­specific initialization parameters. Through which interface can a servlet access these initialization parameters?
Answer: A

© 2014, All Rights Reserved