nerdexam
Oracle

1Z0-809 · Question #272

Given the information: Emp table has 10 records. Given the code fragment: try (Connection con = DriverManager.getConnection ("Connection_String")); { Statement stmt = con.createStatement…

The correct answer is B. int totRows=0; while(rs.next()) {totRows++;}. You've hit your session limit · resets 5:20pm (America/New_York)

Question

Given the information: Emp table has 10 records. Given the code fragment: try (Connection con = DriverManager.getConnection ("Connection_String")); { Statement stmt = con.createStatement (ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); ResultSet rs = stmt.executeQuery ("SELECT * FROM EMP"); { // Line n1 } Which code fragment, inserted at Line n1, helps you determine the number of records in ResultSet?

Options

  • Ars.getMetaData().getRowCount();
  • Bint totRows=0; while(rs.next()) {totRows++;}
  • Crs.last(); int totRows = rs.getRowCount();
  • Drs.last(); int totRows = rs.getRowId(1);

How the community answered

(56 responses)
  • A
    5% (3)
  • B
    84% (47)
  • C
    2% (1)
  • D
    9% (5)

Explanation

You've hit your session limit · resets 5:20pm (America/New_York)

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice