|
|||||||||||
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 | +--iglu.jdbc.SQLTableModel
A class to provide data to a table based on an sql select statement. This makes browsing a databse table in Java quite easy. What makes this more powerful than an ordinary TableModel is that you can specify what fields of the query to display on the table, but still retrieve the values of the other fields from the table model. See JDBCTableModel for more. The nifty thing about this is that you can change the contents of the table by running newQuery. Let's you change the contents of a table on-the-fly.
JDBCTableModel
,
Serialized FormField Summary | |
protected java.sql.Connection |
sqlConnection
The connection to the database |
protected java.lang.String |
sqlStatement
the sql statement to print |
Fields inherited from class iglu.jdbc.JDBCTableModel |
bm, bookmark, colsToDisplay, numRows, rs |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
SQLTableModel(java.sql.Connection sqlc)
create an empty model, only specifying the connection. |
|
SQLTableModel(java.lang.String sqls,
java.sql.Connection sqlc)
create a table model from the given sql statement display all collumns. |
|
SQLTableModel(java.lang.String sqls,
java.sql.Connection sqlc,
int[] ncols)
create a table model form the given sql statement, displaying the columns listed in ncols |
Method Summary | |
protected void |
executeSQL()
re-execute the sql statement |
java.lang.String |
getSql()
get the sql statement upon which this table is based |
void |
newQuery(java.lang.String nsql,
boolean recalcCols)
executes a new sql statement, assuming the same column count/ display information if recalcCols is false. |
void |
newQuery(java.lang.String nsql,
int[] ncols)
execute a new sql statement, letting the column information change |
void |
reQuery()
re-execute the sql statement, and issue a fireTableChanged event |
protected void |
showAllCols()
configure the object to show all the columns. |
Methods inherited from class iglu.jdbc.JDBCTableModel |
bookmark, figureNumRows, getBookmarkString, getColumnCount, getColumnName, getRowCount, getValueAt, rs, setBookmark, setColsToDisplay |
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 |
protected java.lang.String sqlStatement
protected java.sql.Connection sqlConnection
Constructor Detail |
public SQLTableModel(java.sql.Connection sqlc)
public SQLTableModel(java.lang.String sqls, java.sql.Connection sqlc)
public SQLTableModel(java.lang.String sqls, java.sql.Connection sqlc, int[] ncols)
Method Detail |
public void reQuery()
public void newQuery(java.lang.String nsql, boolean recalcCols)
public void newQuery(java.lang.String nsql, int[] ncols)
protected void executeSQL()
protected void showAllCols()
public java.lang.String getSql()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |