| org.jfree.data.category.DefaultCategoryDataset org.jfree.data.jdbc.JDBCCategoryDataset
JDBCCategoryDataset | public class JDBCCategoryDataset extends DefaultCategoryDataset (Code) | | A
CategoryDataset implementation over a database JDBC result set.
The dataset is populated via a call to
JDBCCategoryDataset.executeQuery(String) with
the string SQL query. The SQL query must return at least two columns. The
first column will be the category name and remaining columns values (each
column represents a series). Subsequent calls to
JDBCCategoryDataset.executeQuery(String) will refresh the dataset.
The database connection is read-only and no write back facility exists.
NOTE: Many people have found this class too restrictive in general use.
For the greatest flexibility, please consider writing your own code to read
data from a ResultSet and populate a
DefaultCategoryDataset directly.
|
Method Summary | |
public void | executeQuery(String query) Populates the dataset by executing the supplied query against the
existing database connection. | public void | executeQuery(Connection con, String query) Populates the dataset by executing the supplied query against the
existing database connection. | public boolean | getTranspose() Returns a flag that controls whether or not the table values are
transposed when added to the dataset. | public void | setTranspose(boolean transpose) Sets a flag that controls whether or not the table values are transposed
when added to the dataset. |
JDBCCategoryDataset | public JDBCCategoryDataset(String url, String driverName, String user, String passwd) throws ClassNotFoundException, SQLException(Code) | | Creates a new dataset with a database connection.
Parameters: url - the URL of the database connection. Parameters: driverName - the database driver class name. Parameters: user - the database user. Parameters: passwd - the database user's password. throws: ClassNotFoundException - if the driver cannot be found. throws: SQLException - if there is an error obtaining a connection to the database. |
JDBCCategoryDataset | public JDBCCategoryDataset(Connection connection)(Code) | | Create a new dataset with the given database connection.
Parameters: connection - the database connection. |
JDBCCategoryDataset | public JDBCCategoryDataset(Connection connection, String query) throws SQLException(Code) | | Creates a new dataset with the given database connection, and executes
the supplied query to populate the dataset.
Parameters: connection - the connection. Parameters: query - the query. throws: SQLException - if there is a problem executing the query. |
executeQuery | public void executeQuery(String query) throws SQLException(Code) | | Populates the dataset by executing the supplied query against the
existing database connection. If no connection exists then no action
is taken.
The results from the query are extracted and cached locally, thus
applying an upper limit on how many rows can be retrieved successfully.
Parameters: query - the query. throws: SQLException - if there is a problem executing the query. |
executeQuery | public void executeQuery(Connection con, String query) throws SQLException(Code) | | Populates the dataset by executing the supplied query against the
existing database connection. If no connection exists then no action
is taken.
The results from the query are extracted and cached locally, thus
applying an upper limit on how many rows can be retrieved successfully.
Parameters: con - the connection. Parameters: query - the query. throws: SQLException - if there is a problem executing the query. |
getTranspose | public boolean getTranspose()(Code) | | Returns a flag that controls whether or not the table values are
transposed when added to the dataset.
A boolean. |
setTranspose | public void setTranspose(boolean transpose)(Code) | | Sets a flag that controls whether or not the table values are transposed
when added to the dataset.
Parameters: transpose - the flag. |
Methods inherited from org.jfree.data.category.DefaultCategoryDataset | public void addValue(Number value, Comparable rowKey, Comparable columnKey)(Code)(Java Doc) public void addValue(double value, Comparable rowKey, Comparable columnKey)(Code)(Java Doc) public void clear()(Code)(Java Doc) public Object clone() throws CloneNotSupportedException(Code)(Java Doc) public boolean equals(Object obj)(Code)(Java Doc) public int getColumnCount()(Code)(Java Doc) public int getColumnIndex(Comparable key)(Code)(Java Doc) public Comparable getColumnKey(int column)(Code)(Java Doc) public List getColumnKeys()(Code)(Java Doc) public int getRowCount()(Code)(Java Doc) public int getRowIndex(Comparable key)(Code)(Java Doc) public Comparable getRowKey(int row)(Code)(Java Doc) public List getRowKeys()(Code)(Java Doc) public Number getValue(int row, int column)(Code)(Java Doc) public Number getValue(Comparable rowKey, Comparable columnKey)(Code)(Java Doc) public int hashCode()(Code)(Java Doc) public void incrementValue(double value, Comparable rowKey, Comparable columnKey)(Code)(Java Doc) public void removeColumn(int columnIndex)(Code)(Java Doc) public void removeColumn(Comparable columnKey)(Code)(Java Doc) public void removeRow(int rowIndex)(Code)(Java Doc) public void removeRow(Comparable rowKey)(Code)(Java Doc) public void removeValue(Comparable rowKey, Comparable columnKey)(Code)(Java Doc) public void setValue(Number value, Comparable rowKey, Comparable columnKey)(Code)(Java Doc) public void setValue(double value, Comparable rowKey, Comparable columnKey)(Code)(Java Doc)
|
|
|