February 2014
Beginner
1248 pages
62h 25m
English
The next example (Figs. 24.25 and 24.28) allows the user to enter any query into the program. The example displays the result of a query in a JTable, using a TableModel object to provide the ResultSet data to the JTable. A JTable is a swing GUI component that can be bound to a database to display the results of a query. Class ResultSetTableModel (Fig. 24.25) performs the connection to the database via a TableModel and maintains the ResultSet. Class DisplayQueryResults (Fig. 24.28) creates the GUI and specifies an instance of class ResultSetTableModel to provide data for the JTable.
Class ResultSetTableModel (Fig. 24.25) extends class AbstractTableModel (package javax.swing.table
Read now
Unlock full access