Chapter 3 - 2016-Java Database Connectivity With JDBC
Chapter 3 - 2016-Java Database Connectivity With JDBC
Chapter: Three
Java Database connectivity with JDBC
JDBC Driver
ResultSet rs=pstmt.executeQuery(sql);
// rs is now a cursor
While (rs.next()) {
// process the data
}
Ch-3: JDBC Compiled by: Berhanu A. 18
ResultSets (cont.)
A ResultSet is a very powerful cursor:
• previous(): moves one row back
• absolute(int num): moves to the row with the
specified number
• relative (int num): moves forward or backward
• first() and last()