Basic HTML version of Foils prepared May 19 99

Foil 11 ResultSet class

From Overview of JDBC: Java Database Connectivity Basic Information Track Computational Science Course CPS616 -- Spring Semester 1999. by Nancy McCracken,(Sangetta Aggarwal, Meryem Ispirli, Udayan Parvate, Tom Pulikal, Chao-Wei Ou)


1 A ResultSet contains all the rows which satisfied the conditions of an SQL statement.
2 The cursor of a ResultSet is initially pointed before 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"); double f = r.getDouble("b"); String s = r.getString("c"); System.out.println("row" + i + f + s); }

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Mon Jul 5 1999