GeeCON Prague 2014*
The moose likes JDBC and the fly likes ResultSet.TYPE_SCROLL_SENSITIVE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet.TYPE_SCROLL_SENSITIVE" Watch "ResultSet.TYPE_SCROLL_SENSITIVE" New topic
Author

ResultSet.TYPE_SCROLL_SENSITIVE

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1160
in below code what is the ResultSet.TYPE_SCROLL_SENSITIVE mean.i found this in a tutorials.



private ResultSet getAllUserRS(boolean modify) throws SQLException {
Statement stmt=null;
ResultSet rs=null;

//if (connection.isValid(1000)){
if (modify){
stmt = connection.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
}else{
stmt = connection.createStatement();
}
rs = stmt.executeQuery("Select * from user");

//}

return rs;

}
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

aruna sameera wrote:in below code what is the ResultSet.TYPE_SCROLL_SENSITIVE mean.

Sometimes when you fetched the rows from tables, you want to access each row in randome fashon(can scroll through results set) i.e if you fetched second row, you can go the first row again, if the flag for result set in set as ResultSet.TYPE_SCROLL_SENSITIVE

The more information for this flags can be found here.

And please use Code Tags
 
GeeCON Prague 2014
 
subject: ResultSet.TYPE_SCROLL_SENSITIVE