|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--iglu.jdbc.JDBCTableModel
Implements a Table Model that wraps itself around a JDBC result set we have to keep a buffer, and load it with the values which the table is currently asking for. This meakes it easy to shows SQL queries in a table.
Field Summary | |
protected int[] |
bm
a hack to get around the fact that the ListSelectionEvent does not really tell you what was selected. |
protected int |
bookmark
bookmarked position. |
(package private) int[] |
colsToDisplay
which cols to display. |
(package private) int |
numRows
the number of rows in this result set |
(package private) java.sql.ResultSet |
rs
where the data is stored |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
JDBCTableModel()
Uuuhhhh... |
|
JDBCTableModel(java.sql.ResultSet nrs)
Create a new TableModel based on the result set |
|
JDBCTableModel(java.sql.ResultSet nrs,
int[] ncols)
Create a new TableModel based on the result set. |
Method Summary | |
int |
bookmark()
Get the current book mark |
protected void |
figureNumRows()
figure out how many row there are |
java.lang.String |
getBookmarkString(int whichString)
return the values from the ResultSet at column "whichString". |
int |
getColumnCount()
The number of fields which will show up on the table |
java.lang.String |
getColumnName(int columnIndex)
Uses the Field names as the name to show in the column |
int |
getRowCount()
Return the number of rows in the model |
java.lang.Object |
getValueAt(int row,
int column)
Returns the value at row, column |
java.sql.ResultSet |
rs()
get the result set which underlies the table model |
javax.swing.event.ListSelectionListener |
setBookmark()
a listselectionlistener which sets the result set's current row to the highlighted item. |
void |
setColsToDisplay(int[] n)
Change the columns from the result set to display. |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.sql.ResultSet rs
int numRows
int[] colsToDisplay
protected int bookmark
protected int[] bm
Constructor Detail |
public JDBCTableModel()
public JDBCTableModel(java.sql.ResultSet nrs)
nrs
- public JDBCTableModel(java.sql.ResultSet nrs, int[] ncols)
nrs
- ncols
- Method Detail |
public int getRowCount()
public int getColumnCount()
public java.lang.Object getValueAt(int row, int column)
row
- column
- public java.lang.String getColumnName(int columnIndex)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
columnIndex
- public int bookmark()
public javax.swing.event.ListSelectionListener setBookmark()
protected void figureNumRows()
public java.lang.String getBookmarkString(int whichString)
public void setColsToDisplay(int[] n)
public java.sql.ResultSet rs()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |