| java.lang.Object javax.swing.table.AbstractTableModel org.jfree.report.modules.misc.tablemodel.ScrollableResultSetTableModel
ScrollableResultSetTableModel | public class ScrollableResultSetTableModel extends AbstractTableModel implements CloseableTableModel(Code) | | 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.
author: Thomas Morgner |
Method Summary | |
public void | close() Clears the model of the current result set. | public Class | getColumnClass(int column) Returns the class of the resultset column. | public String | getColumnClassName(int column) Returns the classname of the resultset column. | public int | getColumnCount() Returns the number of columns in the ResultSet. | public String | getColumnName(int column) Returns the columnLabel or column name for the given column. | public int | getRowCount() Get a rowCount. | public Object | getValueAt(int row, int column) Returns the value of the specified row and the specified column from within the
resultset.
Parameters: row - the row index. Parameters: column - the column index. | public boolean | isLabelMapMode() Returns the column name mode used to map column names into column indices. | public void | updateResultSet(ResultSet resultset) Updates the result set in this model with the given ResultSet object. |
ScrollableResultSetTableModel | public ScrollableResultSetTableModel(ResultSet resultset, boolean labelMapMode) throws SQLException(Code) | | Constructs the model.
Parameters: resultset - the result set. Parameters: labelMapMode - defines, whether to use column names or column labels to computethe column index. throws: SQLException - if there is a problem with the result set. |
ScrollableResultSetTableModel | protected ScrollableResultSetTableModel(boolean labelMapMode)(Code) | | Creates a new scrollable result set with no resultset assigned and the specified
label map mode.
Parameters: labelMapMode - defines, whether to use column names or column labels to computethe column index. |
close | public void close()(Code) | | Clears the model of the current result set. The resultset is closed.
|
getColumnClass | public Class getColumnClass(int column)(Code) | | Returns the class of the resultset column. Returns Object.class if an error
occurred.
Parameters: column - the column index. the column class. |
getColumnClassName | public String getColumnClassName(int column)(Code) | | Returns the classname of the resultset column. Returns Object.class if an error
occurred.
Parameters: column - the column index. the column class name. |
getColumnCount | public int getColumnCount()(Code) | | Returns the number of columns in the ResultSet. Returns 0 if no result set is set or
the column count could not be retrieved.
the column count. See Also: java.sql.ResultSetMetaData.getColumnCount |
getColumnName | public String getColumnName(int column)(Code) | | Returns the columnLabel or column name for the given column. Whether the label or the
name is returned depends on the label map mode.
Parameters: column - the column index. the column name. See Also: java.sql.ResultSetMetaData.getColumnLabel(int) |
getRowCount | public int getRowCount()(Code) | | Get a rowCount. This can be a very expensive operation on large datasets. Returns -1
if the total amount of rows is not known to the result set.
the row count. |
getValueAt | public Object getValueAt(int row, int column)(Code) | | Returns the value of the specified row and the specified column from within the
resultset.
Parameters: row - the row index. Parameters: column - the column index. the value. |
updateResultSet | public void updateResultSet(ResultSet resultset) throws SQLException(Code) | | Updates the result set in this model with the given ResultSet object.
Parameters: resultset - the new result set. throws: SQLException - if there is a problem with the result set. |
|
|