CIW
1D0-441 · Question #48
Consider the following code fragment: 1. Statement s = conn.createStatement(); 2. conn.setAutoCommit(false); 3. 4. s.executeUpdate(INSERT INTO Orders VALUES (+ 5. 2029, '05-25-03', 1001, 108…
The correct answer is D. No output is generated. See the full explanation below for the reasoning.
Question
Consider the following code fragment: 1. Statement s = conn.createStatement(); 2. conn.setAutoCommit(false); 3. 4. s.executeUpdate(INSERT INTO Orders VALUES (+ 5. 2029, '05-25-03', 1001, 108, 515.12); 6. 7. conn.rollback(); 8. ResultSet rs = s.executeQuery(SELECT * FROM Orders + 9. WHERE Order_Date = '05-25-03'); 10. while(rs.next()) 11. { 12. System.out.print(rs.getString(1) + ); 13. System.out.println(rs.getString(2)); 14. } 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
- A2029 1001
- B05-25-03 1001
- C2029 05-25-03
- DNo output is generated.
How the community answered
(34 responses)- A3% (1)
- B3% (1)
- C12% (4)
- D82% (28)
Community Discussion
No community discussion yet for this question.
