aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet.TYPE_SCROLL_SENSITIVE" Watch "ResultSet.TYPE_SCROLL_SENSITIVE" New topic
Author

ResultSet.TYPE_SCROLL_SENSITIVE

sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1031
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ResultSet.TYPE_SCROLL_SENSITIVE
 
Similar Threads
Access Database
Scrollable ResultSet not working
PostgreSQL jdbc driver Problem
Try/Catch/Return
total number of rows in ResultSet