Package com.mckoi.jfccontrols
Class ResultSetTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
com.mckoi.jfccontrols.ResultSetTableModel
- All Implemented Interfaces:
Serializable
,TableModel
An implementation of a javax.swing.table.TableModel that updates itself from
a scrollable java.sql.ResultSet source. This directly maps columns from a
query to columns in the table model. If you wish to filter information
from the result set before it is output as a table use
FilteredResultSetTableModel.
- Author:
- Tobias Downer
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the model of the current result set.int
getColumnName
(int column) int
getValueAt
(int row, int column) void
setPreserveTableStructure
(boolean status) A property that checks for changes when a result set is updated and preserves the layout if the updated result set looks similar.void
updateResultSet
(ResultSet result_set) Updates the result set in this model with the given ResultSet object.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Constructor Details
-
ResultSetTableModel
Constructs the model. -
ResultSetTableModel
public ResultSetTableModel()
-
-
Method Details
-
setPreserveTableStructure
public void setPreserveTableStructure(boolean status) A property that checks for changes when a result set is updated and preserves the layout if the updated result set looks similar. This means that the width of columns in the UI will not change to their default values. -
updateResultSet
Updates the result set in this model with the given ResultSet object. -
clear
public void clear()Clears the model of the current result set. -
getRowCount
public int getRowCount() -
getColumnCount
public int getColumnCount() -
getColumnName
- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
getValueAt
-