A
atishay kumar
Hello all
i execute a query using Statement.executeQuery() and get a ResultSet
(rs).
i use rs.next() to move through the ResultSet.. after i move to the
last row.. i want to move to the first row..
HOW DO I DO THAT..
i tried rs.first(); It ways is is not allowed for FORWARD ONLY
RECORDSETS..
then i tried following modifications after seeing the javadoc
Statement stmt = con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
// rs will be scrollable, will not show changes made by others,
// and will be updatable
but still i get an error when i trye rs.first();
any clues will be helpful
thanks
i execute a query using Statement.executeQuery() and get a ResultSet
(rs).
i use rs.next() to move through the ResultSet.. after i move to the
last row.. i want to move to the first row..
HOW DO I DO THAT..
i tried rs.first(); It ways is is not allowed for FORWARD ONLY
RECORDSETS..
then i tried following modifications after seeing the javadoc
Statement stmt = con.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
// rs will be scrollable, will not show changes made by others,
// and will be updatable
but still i get an error when i trye rs.first();
any clues will be helpful
thanks