Save This Page
Home » pentaho-reporting-engine-classic-0.8.10 » org.jfree.report.modules.misc » tablemodel » [javadoc | source]
org.jfree.report.modules.misc.tablemodel
public final class: ResultSetTableModelFactory [javadoc | source]
java.lang.Object
   org.jfree.report.modules.misc.tablemodel.ResultSetTableModelFactory
Creates a TableModel which is backed up by a ResultSet. If the ResultSet is scrollable, a org.jfree.report.modules.misc.tablemodel.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 "org.jfree.report.modules.misc.tablemodel.TableFactoryMode" is set to "simple".

Field Summary
public static final  String COLUMN_NAME_MAPPING_KEY    The configuration key defining how to map column names to column indices. 
public static final  String RESULTSET_FACTORY_MODE    The 'ResultSet factory mode'. 
Method from org.jfree.report.modules.misc.tablemodel.ResultSetTableModelFactory Summary:
createTableModel,   createTableModel,   generateDefaultTableModel,   generateDefaultTableModel,   getInstance,   updateMetaData
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.report.modules.misc.tablemodel.ResultSetTableModelFactory Detail:
 public CloseableTableModel createTableModel(ResultSet rs) throws SQLException 
    Creates a table model by using the given ResultSet as the backend. If the ResultSet is scrollable (the type is not TYPE_FORWARD_ONLY), an instance of org.jfree.report.modules.misc.tablemodel.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.

 public CloseableTableModel createTableModel(ResultSet rs,
    boolean labelMapping) throws SQLException 
    Creates a table model by using the given ResultSet as the backend. If the ResultSet is scrollable (the type is not TYPE_FORWARD_ONLY), an instance of org.jfree.report.modules.misc.tablemodel.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.

 public CloseableTableModel generateDefaultTableModel(ResultSet rs) throws SQLException 
    Generates a 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 ....

 public CloseableTableModel generateDefaultTableModel(ResultSet rs,
    boolean labelMapping) throws SQLException 
    Generates a 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 ....

 public static synchronized ResultSetTableModelFactory getInstance() 
    Returns the singleton instance of the factory.
 public static  void updateMetaData(ResultSetMetaData rsmd,
    DefaultTableMetaData metaData,
    int column)