This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to move to previous record

 
Ric T
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to create a scrollable ResultSet:

or using preparedStatement:

Jamie
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic