Class JDBCMultiCategoryDataset

java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.category.DefaultCategoryDataset
org.jfree.data.jdbc.JDBCCategoryDataset
net.simplace.core.ui.jfreechart.JDBCMultiCategoryDataset
All Implemented Interfaces:
ObjectInputValidation, Serializable, Cloneable, org.jfree.data.category.CategoryDataset, org.jfree.data.general.Dataset, org.jfree.data.KeyedValues2D, org.jfree.data.Values2D, org.jfree.util.PublicCloneable

public class JDBCMultiCategoryDataset extends org.jfree.data.jdbc.JDBCCategoryDataset
This is an enhanced version of the JFreeChart JDBCCategoryDataset class. While the JFreeChart class expects the associated SQL statement to return a separate numerical column for every series, this class also handles statements that return 3 columns: two VARCHAR columns that contain the category's and series' names and a single numerical column that contains the values. If a statement returns three columns as described above, the second column will be interpreted as series names. Otherwise, this class will return the same result as the JFreeChart implementation.
Author:
Andreas Enders, ckunze
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new CategoryDataset with the given connection.
    Creates a CategoryDataset and initializes it with the values returned by the specified SQL query.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    executeQuery(Connection aConnection, String aQuery)
    Fills the dataset with the data returned by the specified query.

    Methods inherited from class org.jfree.data.jdbc.JDBCCategoryDataset

    executeQuery, getTranspose, setTranspose

    Methods inherited from class org.jfree.data.category.DefaultCategoryDataset

    addValue, addValue, clear, clone, equals, getColumnCount, getColumnIndex, getColumnKey, getColumnKeys, getRowCount, getRowIndex, getRowKey, getRowKeys, getValue, getValue, hashCode, incrementValue, removeColumn, removeColumn, removeRow, removeRow, removeValue, setValue, setValue

    Methods inherited from class org.jfree.data.general.AbstractDataset

    addChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.jfree.data.general.Dataset

    addChangeListener, getGroup, removeChangeListener, setGroup
  • Constructor Details

    • JDBCMultiCategoryDataset

      public JDBCMultiCategoryDataset(Connection aConnection, String aQuery) throws SQLException
      Creates a CategoryDataset and initializes it with the values returned by the specified SQL query. Please refer to this class's description for more information on how columns in the result set are tranlated to categories and series.
      Parameters:
      aConnection -
      aQuery -
      Throws:
      SQLException
    • JDBCMultiCategoryDataset

      public JDBCMultiCategoryDataset(Connection aConnection)
      Creates a new CategoryDataset with the given connection.
      Parameters:
      aConnection -
  • Method Details

    • executeQuery

      public void executeQuery(Connection aConnection, String aQuery) throws SQLException
      Fills the dataset with the data returned by the specified query. Please refer to this class's description for more information on how columns in the result set are tranlated to categories and series.
      Overrides:
      executeQuery in class org.jfree.data.jdbc.JDBCCategoryDataset
      Throws:
      SQLException