Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet.TYPE_SCROLL_SENSITIVE

 
sam liya
Ranch Hand
Posts: 1240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic