Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

ResultSet.TYPE_SCROLL_SENSITIVE

 
Ranch Hand
Posts: 1325
1
  • 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;

}
 
Ranch Hand
Posts: 2908
1
Spring Java 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
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic