|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.pentaho.reporting.engine.classic.core.modules.misc.tablemodel.ScrollableResultSetTableModel
public class 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.
Constructor Summary | |
---|---|
ScrollableResultSetTableModel(ResultSet resultset,
boolean labelMapMode)
Deprecated. |
|
ScrollableResultSetTableModel(ResultSet resultset,
boolean labelMapMode,
boolean closeStatement)
Constructs the model. |
Method Summary | |
---|---|
void |
close()
Clears the model of the current result set. |
DataAttributes |
getCellDataAttributes(int row,
int column)
Returns the meta-attribute as Java-Object. |
DataAttributes |
getColumnAttributes(int column)
Returns the column-level attributes for the given column. |
Class |
getColumnClass(int column)
Returns the class of the resultset column. |
String |
getColumnClassName(int column)
Deprecated. |
int |
getColumnCount()
Returns the number of columns in the ResultSet. |
String |
getColumnName(int column)
Returns the columnLabel or column name for the given column. |
int |
getRowCount()
Get a rowCount. |
DataAttributes |
getTableAttributes()
Returns table-wide attributes. |
Object |
getValueAt(int row,
int column)
Returns the value of the specified row and the specified column from within the resultset. |
boolean |
isCellDataAttributesSupported()
Checks, whether cell-data attributes are supported by this tablemodel implementation. |
boolean |
isLabelMapMode()
Returns the column name mode used to map column names into column indices. |
void |
updateResultSet(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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt |
Constructor Detail |
---|
public ScrollableResultSetTableModel(ResultSet resultset, boolean labelMapMode) throws SQLException
resultset
- the result set.labelMapMode
- defines, whether to use column names or column labels to compute the column index.
SQLException
- if there is a problem with the result set.public ScrollableResultSetTableModel(ResultSet resultset, boolean labelMapMode, boolean closeStatement) throws SQLException
resultset
- the result set.labelMapMode
- defines, whether to use column names or column labels to compute the column index.closeStatement
- a flag indicating whether the statement, that created the resultset should be closed when
the resultset gets closed.
SQLException
- if there is a problem with the result set.Method Detail |
---|
public boolean isLabelMapMode()
ResultSetMetaData.getColumnLabel(int)
,
ResultSetMetaData.getColumnName(int)
public void updateResultSet(ResultSet resultset) throws SQLException
resultset
- the new result set.
SQLException
- if there is a problem with the result set.public void close()
close
in interface CloseableTableModel
public int getRowCount()
getRowCount
in interface TableModel
public int getColumnCount()
getColumnCount
in interface TableModel
ResultSetMetaData.getColumnCount()
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
column
- the column index.
ResultSetMetaData.getColumnLabel(int)
public Object getValueAt(int row, int column)
getValueAt
in interface TableModel
row
- the row index.column
- the column index.
public Class getColumnClass(int column)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
column
- the column index.
public String getColumnClassName(int column)
column
- the column index.
public DataAttributes getCellDataAttributes(int row, int column)
getCellDataAttributes
in interface MetaTableModel
row
- the row of the cell for which the meta-data is queried.column
- the index of the column for which the meta-data is queried.
public boolean isCellDataAttributesSupported()
MetaTableModel
isCellDataAttributesSupported
in interface MetaTableModel
public DataAttributes getColumnAttributes(int column)
MetaTableModel
getColumnAttributes
in interface MetaTableModel
column
- the column.
public DataAttributes getTableAttributes()
getTableAttributes
in interface MetaTableModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |