org.jfree.data.jdbc
public class JDBCCategoryDataset extends DefaultCategoryDataset
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.
Constructor Summary | |
---|---|
JDBCCategoryDataset(String url, String driverName, String user, String passwd)
Creates a new dataset with a database connection.
| |
JDBCCategoryDataset(Connection connection)
Create a new dataset with the given database connection.
| |
JDBCCategoryDataset(Connection connection, String query)
Creates a new dataset with the given database connection, and executes
the supplied query to populate the dataset.
|
Method Summary | |
---|---|
void | executeQuery(String query)
Populates the dataset by executing the supplied query against the
existing database connection. |
void | executeQuery(Connection con, String query)
Populates the dataset by executing the supplied query against the
existing database connection. |
boolean | getTranspose()
Returns a flag that controls whether or not the table values are
transposed when added to the dataset.
|
void | setTranspose(boolean transpose)
Sets a flag that controls whether or not the table values are transposed
when added to the dataset.
|
Parameters: url the URL of the database connection. driverName the database driver class name. user the database user. passwd the database user's password.
Throws: ClassNotFoundException if the driver cannot be found. SQLException if there is an error obtaining a connection to the database.
Parameters: connection the database connection.
Parameters: connection the connection. query the query.
Throws: SQLException if there is a problem executing the query.
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.
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. query the query.
Throws: SQLException if there is a problem executing the query.
Returns: A boolean.
Parameters: transpose the flag.