|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.jfree.report.modules.misc.tablemodel.ScrollableResultSetTableModel
A tableModel which is backed up by a java.sql.ResultSet. Use this to directly feed your
database data into JFreeReport. If you have trouble using this TableModel and you have
either enough memory or your query result is not huge, you may want to use
ResultSetTableModelFactory.generateDefaultTableModel (ResultSet rs)
.
That implementation will read all data from the given ResultSet and keep that data in
memory.
Use the close() function to close the ResultSet contained in this model.
Field Summary |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
protected |
ScrollableResultSetTableModel(boolean labelMapMode)
Creates a new scrollable result set with no resultset assigned and the specified label map mode. |
|
ScrollableResultSetTableModel(java.sql.ResultSet resultset,
boolean labelMapMode)
Constructs the model. |
Method Summary | |
void |
close()
Clears the model of the current result set. |
java.lang.Class |
getColumnClass(int column)
Returns the class of the resultset column. |
java.lang.String |
getColumnClassName(int column)
Returns the classname of the resultset column. |
int |
getColumnCount()
Returns the number of columns in the ResultSet. |
java.lang.String |
getColumnName(int column)
Returns the columnLabel or column name for the given column. |
int |
getRowCount()
Get a rowCount. |
java.lang.Object |
getValueAt(int row,
int column)
Returns the value of the specified row and the specified column from within the resultset. |
boolean |
isLabelMapMode()
Returns the column name mode used to map column names into column indices. |
void |
updateResultSet(java.sql.ResultSet resultset)
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, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt |
Constructor Detail |
public ScrollableResultSetTableModel(java.sql.ResultSet resultset, boolean labelMapMode) throws java.sql.SQLException
resultset
- the result set.labelMapMode
- defines, whether to use column names or column labels
to compute the column index.
java.sql.SQLException
- if there is a problem with the result set.protected ScrollableResultSetTableModel(boolean labelMapMode)
labelMapMode
- defines, whether to use column names or column labels
to compute the column index.Method Detail |
public boolean isLabelMapMode()
ResultSetMetaData.getColumnLabel(int)
,
ResultSetMetaData.getColumnName(int)
public void updateResultSet(java.sql.ResultSet resultset) throws java.sql.SQLException
resultset
- the new result set.
java.sql.SQLException
- if there is a problem with the result set.public void close()
close
in interface CloseableTableModel
public int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
ResultSetMetaData.getColumnCount()
public java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
column
- the column index.
ResultSetMetaData.getColumnLabel(int)
public java.lang.Object getValueAt(int row, int column)
getValueAt
in interface javax.swing.table.TableModel
row
- the row index.column
- the column index.
public java.lang.Class getColumnClass(int column)
getColumnClass
in interface javax.swing.table.TableModel
column
- the column index.
public java.lang.String getColumnClassName(int column)
column
- the column index.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |