Wednesday, February 23, 2005

jGuru: Paging with Scrollable ResultSets: "For several reasons, Duane and Chrissie have decided to reimplement their basic table viewer program. In order have logic generally reusable, with, for example, servlets and even with Swing JTables when it is inappropriate to bring down all the data at once, the program will retrieve and display a page at a time ( although the actual block size fetched is left up to the driver, ) in a textarea.
The application should present data formatted and in a set page size using a scrollable ResultSet. Optional entry of Order By columns should be allowed. A separate window should display metadata about the table and the ResultSet. The table to be viewed is selectable, but to exercise the application, Chrissie sets the initial default to CoffeeComp, the table loaded in Batch Update Facility, which contains 240 rows.
Note that this program is more appropriate for large amounts of data than ConnectJ, but uses SELECT * and so should still, as with the other exercises, not be used in production. There is LOTS of code, but most of it is boilerplate and formatting, both for the Swing and JDBC portions. The reader tasks are limited to the areas relevant to scrollable ResultSets and Metadata. "