Basic HTML version of Foils prepared 7 October 97

Foil 11 ResultSet class

From Overview of JDBC and its use with Microsoft Access ARL Database Tutorial -- February 98. by Nancy McCracken(Sangetta Aggarwal, Udayan Parvate, Tom Pulikal)


A ResultSet contains all the rows which satisfied the conditions of an SQL statement.
The cursor of a ResultSet is initially pointed to the first row, the method next( ) moves the cursor down one row. ResultSet r = stmt.executeQuery("select a,b,c from table1"); while (r.next( )) { //print values for current row int i = r.getInt("a"); float f = r.getFloat("b"); String s = r.getString("c"); System.out.println("row" + i + f + s); }



© on Mon Oct 13 1997