Types of ResultSets in JDBC
They are two types of ResultSets in JDBC
Non Scrollable ResultSet: By default a ResultSet is non scrollableA non scrollable resultset can allows the cursor to move only in forward direction.
Syntax for non-scrollable :Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SQL command");
Scrollable ResultSet: A scrollable resultset allows the cursor to move in both forward and backward and random directions. Comparatively the performance of scrollable resultset is better than non scrollable. To make a resultset of jdbc as scrollable we need to pass Type and Mode integer values as parameters while creating a statement object.Syntax for scrollable :Statement stmt = con.create Satement(int type, int mode) ;
Resultset rs = stmt.executeQuery("SQL command");