Valid 1Z0-804 Dumps shared by ExamDiscuss.com for Helping Passing 1Z0-804 Exam! ExamDiscuss.com now offer the newest 1Z0-804 exam dumps, the ExamDiscuss.com 1Z0-804 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1Z0-804 dumps with Test Engine here:
Given the code fragment: Assume that the SQL queries return records. What is the result of compiling and executing this code fragment?
Correct Answer: C
Explanation/Reference: Explanation: !!! The given Code prints Error -- the second query clears the ResultSet !? ErrorMessage: Operation not allowed after ResultSet closed It would print A, if second Query i set to rs = stmt.executeQuery("SELECT ID FROM Customer"); // Line *** It would print B, if Line *** is missing. // The program compiles and runs fine. Both executeQuery statements will run. The first executeQuery statement (ResultSet rs = stmt.executeQuery(query);) will set the rs Resultset. It will be used in the while loop. EmployIDs will be printed. Note: Executes the given SQL statement, which returns a single ResultSet object. Parameters: sql - an SQL statement to be sent to the database, typically a static SQL SELECT statement Returns: a ResultSet object that contains the data produced by the given query; never null