... setQuery (lines 134–154) performs a query, it stores the number of rows in variable numberOfRows.

ResultSetTableModel Method getValueAt

Method getValueAt (lines 113–131) returns the Object in a particular row and column of the model’s underlying ResultSet. Line 123 uses ResultSet method absolute to position the ResultSet cursor to a specific row. Line 124 uses ResultSet method getObject to obtain the Object in a specific column of the current row. If an exception occurs, the catch in lines 126–128 prints a stack trace and line 130 returns an empty string as the default value.

ResultSetTableModel Method setQuery

Method setQuery (lines 134–154) executes the query it receives as an argument to obtain a new ResultSet (line 143). Line 146 gets the ...

Get Java How To Program, Late Objects, 11th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.