CIW
1D0-441 · Question #52
1D0-441 Question #52: Real Exam Question with Answer & Explanation
The correct answer is D. No output is generated.. See the full explanation below for the reasoning.
Question
Consider the following code fragment: 1. PreparedStatement ps = conn.prepareStatement 2. (INSERT INTO Orders VALUES (?, ?, ?, ?, ?)); 3. 4. ps.setInt(1, 4000); 5. ps.setString(2, 01-01-05); 6. ps.setInt(3, 1010); 7. ps.setInt(4, 200); 8. ps.setDouble(5, 1050.00); 9. ps.addBatch(); 10. 11. ps.setInt(1, 4001); 12. ps.setInt(3, 2010); 13. ps.addBatch(); 14. 15. ps.setInt(1, 4002); 16. ps.setInt(3, 3010); 17. ps.addBatch(); 18. 19. ps.clearBatch(); 20. 21. Statement s = conn.createStatement(); 22. ResultSet rs = s.executeQuery(SELECT * FROM Orders + 23. WHERE Sales_Rep_no = 200); 24. while(rs.next()) 25. { 26. System.out.print(rs.getString(Order_No) + ); 27. } 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
- A4000
- B4002
- C4000 4001 4002
- DNo output is generated.
Community Discussion
No community discussion yet for this question.
