nerdexam
Oracle

1Z0-860 · Question #245

1Z0-860 Question #245: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-860 to reveal the answer and full explanation for question #245. The question stem and answer options stay visible for context.

Question

Given the following code in an EJB 3.0 session bean: 10. @Resource(name="jdbc/employeeDB") 11. private DataSource dataSource; 12. 13. public void lookupEmployee(String id) { 14. InitialContext ic = new InitialContextO; 15. // insert code here 16. DataSource ds = (DataSource) obj; 17.} Which code, inserted at Line 15, portably looks up the injected resource?

Options

  • AObject obj = ic.lookup("employeeDB");
  • BObject obj = ic.lookup("dataSource");
  • CObject obj = ic.lookup("jdbc/employeeDB");
  • DObject obj = ic.lookup("javacomp/env/employeeDB");
  • EObject obj = ic.lookup("java:comp/env/jdbc/employeeDB");

Unlock 1Z0-860 to see the answer

You've previewed enough free 1Z0-860 questions. Unlock 1Z0-860 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 1Z0-860 Practice