Make a ResultSet Scrollable

Make a ResultSet Scrollable

This code can also be used to navigate through the Resultset backward or forward, or to perform insertions, deletions and updates to update the database.

  //load JDBC Driver// Get the ConnectionStatementstmt=connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);ResultSet resultset=stmt.executeQuery("SQL .." );resultset.absolute(3);//Moves the cursor to the  given row number.resultset.previous();//Moves the cursor to the previous row.


Share the Post: