Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

How to go to previous record

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
In Java I am using Oracle as my backend and I can go to next record, but I am not able to go to the previous record. I tried using rs.previous() method where rs is the object of ResultSet type but doesn't work. I heard about the setFecthDirection() method but how to use this I dont know.
If anyone of you knows please help me out.
Dharam
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can only go backwards if the driver you are using fully supports JDBC 2.0. If I recall, the Oracle drivers are not fully JDBC 2.0 compliant. Check the Oracle web site for details of which functions are not supported.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can always keep a copy in your code, either of just the previous result, or of all the results in the resultset. Then you can traverse at will.
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use Connection.createStatement(int resultSetType, int resultSetConcurrency) method to create a scrollable ResultSet.
 
Bhupinder Dhillon
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Thomas Paul:
You can only go backwards if the driver you are using fully supports JDBC 2.0. If I recall, the Oracle drivers are not fully JDBC 2.0 compliant. Check the Oracle web site for details of which functions are not supported.


FYI, Oracle drivers do have most of the JDBC 2.0 functionality.
http://technet.oracle.com//tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#_29_
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
of course, it depends on which drivers you are actually using.
------------------
Moderator of the JDBC Forum
 
reply
    Bookmark Topic Watch Topic
  • New Topic