CIW
1D0-441 · Question #121
Consider the following code fragment: 1. Statement s = conn.createStatement(); 2. ResultSet rs = s.executeQuery(SELECT * FROM Orders + 3. WHERE Order_Date = '02-22-02'); 4. while(rs.next()) 5…
The correct answer is B. 02-22-02. See the full explanation below for the reasoning.
Question
Consider the following code fragment: 1. Statement s = conn.createStatement(); 2. ResultSet rs = s.executeQuery(SELECT * FROM Orders + 3. WHERE Order_Date = '02-22-02'); 4. while(rs.next()) 5. System.out.println(rs.getString(2)); 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
Options
- A2019
- B02-22-02
- C1003
- DA compile-time error occurs at line 2.
How the community answered
(48 responses)- A4% (2)
- B73% (35)
- C8% (4)
- D15% (7)
Community Discussion
No community discussion yet for this question.
