nerdexam
CIW

1D0-441 · Question #57

Consider the following code fragment: 1. PreparedStatement ps = conn.prepareStatement( 2. SELECT Order_Date, Customer_No + 3. FROM Orders WHERE + 4. Customer_No = ?); 5. 6. ps.setShort(1, 1009) 7…

The correct answer is A. 03-01-02 1009. See the full explanation below for the reasoning.

Question

Consider the following code fragment: 1. PreparedStatement ps = conn.prepareStatement( 2. SELECT Order_Date, Customer_No + 3. FROM Orders WHERE + 4. Customer_No = ?); 5. 6. ps.setShort(1, 1009) 7. 8. ResultSet rs = ps.executeQuery(); 9. while(rs.next()) 10. { 11. System.out.print(rs.getString(1) + ); 12. System.out.println(rs.getString(2)); 13. } Assume that variable conn references a valid and open Connection object to a database containing the Orders relation (shown in the exhibit). Which output is generated?

Exhibit

1D0-441 question #57 exhibit

Options

  • A03-01-02 1009
  • B2025 1009
  • C2025 03-01-02
  • DNo output is generated because a runtime error occurs at line 6.

How the community answered

(55 responses)
  • A
    73% (40)
  • B
    16% (9)
  • C
    4% (2)
  • D
    7% (4)

Community Discussion

No community discussion yet for this question.

Full 1D0-441 Practice