PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

What is the result of attempting to execute the following Java code segment assuming con is a valid reference

Refer to the exhibit to answer the question.

Consider the Products relation defined in the exhibit. What is the result of attempting to execute
the following Java code segment assuming con is a valid reference to an open Connection object?
1. PreparedStatement ps = con.prepareStatement(
2. “SELECT * FROM Products WHERE ” +
3. “Cost < ?”);
4.
5. ps.setDouble(0, 10f);
6.
7. ResultSet rs = ps.executeUpdate();
8. rs.next();
9. System.out.print(rs.getString(1));
10. System.out.println(rs.getString(2));


Page 141 of 263« First...102030...139140141142143...150160170...Last »