File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "ResultSet.TYPE_SCROLL_SENSITIVE" Watch "ResultSet.TYPE_SCROLL_SENSITIVE" New topic


sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1240
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: 2904

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:
It's not a secret anymore!