com.jidesoft.database
Class ResultSetTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
com.jidesoft.database.ResultSetTableModel
- All Implemented Interfaces:
- Serializable, TableModel
- Direct Known Subclasses:
- RowSetTableModel
public class ResultSetTableModel
- extends AbstractTableModel
ResultSetTableModel
uses an existing ResultSet
and display it in a table model.
- See Also:
- Serialized Form
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_recordCount
protected int _recordCount
_currentRow
protected transient int _currentRow
_cache
protected com.jidesoft.database.TableModelCache _cache
_forwardOnly
protected boolean _forwardOnly
_resultSet
protected ResultSet _resultSet
LOGGER
protected static final Logger LOGGER
ResultSetTableModel
public ResultSetTableModel(ResultSet resultSet)
throws SQLException
- Creates a RecordSetTableModel.
- Parameters:
resultSet
- a database ResultSet.
- Throws:
SQLException
- if a database related error happens. It could be because the connection is closed.
ResultSetTableModel
public ResultSetTableModel(ResultSet resultSet,
int recordCount)
throws SQLException
- Creates a RecordSetTableModel.
- Parameters:
resultSet
- a database ResultSet.recordCount
- the record count in the ResultSet.
- Throws:
SQLException
- if a database related error happens. It could be because the connection is closed.
getColumnCount
public int getColumnCount()
getColumnName
public String getColumnName(int column)
- Specified by:
getColumnName
in interface TableModel
- Overrides:
getColumnName
in class AbstractTableModel
getColumnClass
public Class<?> getColumnClass(int columnIndex)
- Specified by:
getColumnClass
in interface TableModel
- Overrides:
getColumnClass
in class AbstractTableModel
getRowCount
public int getRowCount()
invalidateCache
public void invalidateCache(int row)
invalidateCache
public void invalidateCache()
getValueAt
public Object getValueAt(int rowIndex,
int columnIndex)
refreshData
public void refreshData()
throws SQLException
- Queries the ResultSet and create the column information.
- Throws:
SQLException
- if a database access error occurs, this method is called on a closed
Statement
or the given SQL statement produces anything other than a
single ResultSet
object
isCellEditable
public boolean isCellEditable(int rowIndex,
int columnIndex)
- Specified by:
isCellEditable
in interface TableModel
- Overrides:
isCellEditable
in class AbstractTableModel
setValueAt
public void setValueAt(Object aValue,
int rowIndex,
int columnIndex)
- Specified by:
setValueAt
in interface TableModel
- Overrides:
setValueAt
in class AbstractTableModel
setUpdatable
public void setUpdatable(boolean updatable)
isUpdatable
public boolean isUpdatable()
getResultSet
public ResultSet getResultSet()
isForwardOnly
public boolean isForwardOnly()
setForwardOnly
public void setForwardOnly(boolean forwardOnly)
close
public void close()
throws SQLException
- Throws:
SQLException
getMaximumCachedRows
public int getMaximumCachedRows()
setMaximumCachedRows
public void setMaximumCachedRows(int maximumCachedRows)