Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying the next set of a resultset with a next JButton

 
Jeff Foflygen
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello,

I have an application that is currently working in returning data from an oracle database. The place where I am getting stuck is display the next set of a resultset with the click of a JButton called "Next" The resultset returns 15 line items, based on a variable that I pass to it from the swing application. some have 3 sets of 15 line items. Here is the code I have in place so far, any help or thoughts would be much appreciated.

Thanks!
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends on the DB in question. Basically you need to invoke a SQL query which returns only an ordered subset of rows from the database. For the ordering you can use the standard ORDER BY clause and for returning subsets you need to consult the SQL documentation of the DB in question. Mostly it's the LIMIT and/or OFFSET clause, but for some DB's you need to write a stored procedure.
 
Jan Cumps
Bartender
Posts: 2598
12
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JavaRanch FAQ has some suggestions on paginating, and on getting the next set of records.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic