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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet.TYPE_SCROLL_SENSITIVE" Watch "ResultSet.TYPE_SCROLL_SENSITIVE" New topic


sam liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 1071
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);
stmt = connection.createStatement();
rs = stmt.executeQuery("Select * from user");


return rs;

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902

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
Similar Threads
total number of rows in ResultSet
Access Database
PostgreSQL jdbc driver Problem
Scrollable ResultSet not working