|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--com.jrefinery.report.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()
Default constructor. |
|
ScrollableResultSetTableModel(java.sql.ResultSet resultset)
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 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. |
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) throws java.sql.SQLException
resultset
- the result set.
java.sql.SQLException
- if there is a problem with the result set.protected ScrollableResultSetTableModel()
Method Detail |
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
getColumnName
in class javax.swing.table.AbstractTableModel
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
getColumnClass
in class javax.swing.table.AbstractTableModel
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 |