File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to move to previous record
 
Similar Threads
how to scroll data to view other records
My JTable is a bit confused
Help needed to display ResultSet pagewise using jsp
how to display Result set pagewise
Next and previous buttons in jsp