Im writing a java web application using net beans 5.5 and SQL server. I want to read same result set twice. therefore i use resultSet.first(). to go to the first record in record set. How ever it throws an exception. how can I move to first record after i reached end of record set.
Have a look at the API documentation of class java.sql.Connection. There are variants of the methods createStatement(), prepareStatement() and prepareCall() that allow you to specify the result set type. There, you can specify that you need a scrollable result set.
Also, your JDBC driver needs to support scrollable result sets, otherwise it isn't going to work.