nerdexam
Oracle

1Z0-804 · Question #75

Given the code fragment: Assume that the SQL query matches one record. What is the result of compiling and executing this code?

The correct answer is A. The code prints Error. The code compiles fine. A: prints Error: rs.next() fehlt !! Fehlermeldung: Before start of result set mit rs.next() Aufruf : The code would run fine. public int getInt(String columnName) throws SQLException Retrieves the value of the designated column in the current row of this…

Building Database Applications with JDBC

Question

Given the code fragment:

Assume that the SQL query matches one record. What is the result of compiling and executing this code?

Exhibit

1Z0-804 question #75 exhibit

Options

  • AThe code prints Error.
  • BThe code prints the employee ID.
  • CCompilation fails due to an error at line 13.
  • DCompilation fails due to an error at line 14.

How the community answered

(49 responses)
  • A
    73% (36)
  • B
    16% (8)
  • C
    4% (2)
  • D
    6% (3)

Explanation

The code compiles fine. A: prints Error: rs.next() fehlt !! Fehlermeldung: Before start of result set mit rs.next() Aufruf : The code would run fine. public int getInt(String columnName) throws SQLException Retrieves the value of the designated column in the current row of this ResultSet object as an int in the Javaprogramming language

Topics

#ResultSet#PreparedStatement#column access#JDBC

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice