|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jrefinery.report.tablemodel.ResultSetTableModelFactory
Creates a TableModel which is backed up by a ResultSet.
If the ResultSet is scrollable, a
ScrollableResultSetTableModel is
created, otherwise all data is copied from the ResultSet into a
DefaultTableModel.
The creation of a DefaultTableModel can be forced if the system property
"com.jrefinery.report.TableFactoryMode" is set to "simple".
| Method Summary | |
CloseableTableModel |
createTableModel(java.sql.ResultSet rs)
Creates a table model by using the given ResultSet as the backend.
|
CloseableTableModel |
generateDefaultTableModel(java.sql.ResultSet rs)
Generates a TableModel that gets its contents filled from a
ResultSet. |
static ResultSetTableModelFactory |
getInstance()
Returns the singleton instance of the factory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public CloseableTableModel createTableModel(java.sql.ResultSet rs)
throws java.sql.SQLException
ResultSet as the backend.
If the ResultSet is scrollable (the type is not TYPE_FORWARD_ONLY),
an instance of ScrollableResultSetTableModel is
returned. This model uses the
extended capabilities of scrollable resultsets to directly read data from the database
without caching or the need of copying the complete ResultSet into the programs
memory.
If the ResultSet lacks the scollable features, the data will be copied into a
DefaultTableModel and the ResultSet gets closed.
rs - the result set.
java.sql.SQLException - if there is a problem with the result set.
public CloseableTableModel generateDefaultTableModel(java.sql.ResultSet rs)
throws java.sql.SQLException
TableModel that gets its contents filled from a
ResultSet. The column names of the ResultSet will form the column
names of the table model.
Hint: To customize the names of the columns, use the SQL column aliasing (done with
SELECT nativecolumnname AS "JavaColumnName" FROM ....
rs - the result set.
java.sql.SQLException - if there is a problem with the result set.public static ResultSetTableModelFactory getInstance()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||