public class ResultSetTableModel
extends javax.swing.table.AbstractTableModel
Constructor and Description |
---|
ResultSetTableModel()
Simple constructor.
|
ResultSetTableModel(java.sql.ResultSet rs)
Construct a ResultSetTableModel with an existing ResultSet.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class |
getColumnClass(int column)
Get the object class represented by a table model column.
|
int |
getColumnCount()
Get the number of columns in the model.
|
java.lang.String |
getColumnName(int column)
Get the name of a given column.
|
int |
getRowCount()
Get the number of rows in the model.
|
java.lang.Object |
getValueAt(int row,
int column)
Get the object stored in a given cell.
|
boolean |
isCellEditable(int row,
int column)
Check if a given cell is editable.
|
void |
setResultSet(java.sql.ResultSet rs)
Set or change the result set used for the model.
|
void |
setValueAt(java.lang.Object value,
int row,
int column)
Set the object stored in a given cell.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
public ResultSetTableModel()
public ResultSetTableModel(java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
public void setResultSet(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- new resultset to usejava.sql.SQLException
public java.lang.Class getColumnClass(int column)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
column
- int number of the column to access; columns are
numbered beginning with 0public int getColumnCount()
public java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
column
- int index of the columnpublic int getRowCount()
public boolean isCellEditable(int row, int column)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
row
- int index of the cell rowcolumn
- int index of the cell columntrue
if the cell at row/column index can
be edited; false
otherwisepublic java.lang.Object getValueAt(int row, int column)
row
- int index of the cell rowcolumn
- int index of the cell columnpublic void setValueAt(java.lang.Object value, int row, int column)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
row
- int index of the cell rowcolumn
- int index of the cell column