aspose file tools*
The moose likes JDBC and the fly likes Displaying the next set of a resultset with a next JButton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Displaying the next set of a resultset with a next JButton" Watch "Displaying the next set of a resultset with a next JButton" New topic
Author

Displaying the next set of a resultset with a next JButton

Jeff Foflygen
Greenhorn

Joined: Mar 12, 2009
Posts: 12

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

Joined: Oct 08, 2006
Posts: 2458
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

Joined: Dec 20, 2006
Posts: 2503
    
    8

The JavaRanch FAQ has some suggestions on paginating, and on getting the next set of records.


OCUP UML fundamental and ITIL foundation
youtube channel
 
Don't get me started about those stupid light bulbs.
 
subject: Displaying the next set of a resultset with a next JButton