This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes how to move to previous record Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to move to previous record" Watch "how to move to previous record" New topic
Author

how to move to previous record

Ric T
Greenhorn

Joined: Aug 01, 2001
Posts: 4
I'm using Swing Components in displaying records from the table. I used ResultSet for the records. I also put a next and previous button to view the data and assign it in JTextField. When I click on previous w/c is i used the previous() method in ResultSet, it will display a message that, TYPE_FORWARD_ONLY and when I add those parameters in order to set the ResultSet, it will display that feature is not supported. I used MS Access as my Database.
hope you can help me with that. thnx
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

you need to create a scrollable ResultSet:

or using preparedStatement:

Jamie
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

If the above methods do not work for you (error message like "features not implemented") then your database driver can not use scrollable resultset because it does not support it. If this is the problem I would suggest changing your database to Postgres or mySQL (both free). There seems to be a lot of problems with the drivers to MS Access. If you are stuck using it, then try to download the latest version of your driver or find a better driver to connect to access with.
Postgres: http://apachetoday.com/news_story.php3?ltsn=2000-08-14-008-01-PR-MR-SW
Jamie
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to move to previous record
 
Similar Threads
Next and previous buttons in jsp
My JTable is a bit confused
how to scroll data to view other records
Help needed to display ResultSet pagewise using jsp
how to display Result set pagewise