| org.jfree.data.general.DefaultPieDataset org.jfree.data.jdbc.JDBCPieDataset
JDBCPieDataset | public class JDBCPieDataset extends DefaultPieDataset (Code) | | A
PieDataset that reads data from a database via JDBC.
A query should be supplied that returns data in two columns, the first
containing VARCHAR data, and the second containing numerical data. The
data is cached in-memory and can be refreshed at any time.
|
Method Summary | |
public void | close() | public void | executeQuery(String query) ExecuteQuery will attempt execute the query passed to it against the
existing database connection. | public void | executeQuery(Connection con, String query) ExecuteQuery will attempt execute the query passed to it against the
existing database connection. |
JDBCPieDataset | public JDBCPieDataset(String url, String driverName, String user, String password) throws SQLException, ClassNotFoundException(Code) | | Creates a new JDBCPieDataset and establishes a new database connection.
Parameters: url - the URL of the database connection. Parameters: driverName - the database driver class name. Parameters: user - the database user. Parameters: password - the database users password. throws: ClassNotFoundException - if the driver cannot be found. throws: SQLException - if there is a problem obtaining a database connection. |
JDBCPieDataset | public JDBCPieDataset(Connection con)(Code) | | Creates a new JDBCPieDataset using a pre-existing database connection.
The dataset is initially empty, since no query has been supplied yet.
Parameters: con - the database connection. |
JDBCPieDataset | public JDBCPieDataset(Connection con, String query) throws SQLException(Code) | | Creates a new JDBCPieDataset using a pre-existing database connection.
The dataset is initialised with the supplied query.
Parameters: con - the database connection. Parameters: query - the database connection. throws: SQLException - if there is a problem executing the query. |
close | public void close()(Code) | | Close the database connection
|
executeQuery | public void executeQuery(String query) throws SQLException(Code) | | ExecuteQuery will attempt execute the query passed to it 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 to be executed. throws: SQLException - if there is a problem executing the query. |
executeQuery | public void executeQuery(Connection con, String query) throws SQLException(Code) | | ExecuteQuery will attempt execute the query passed to it 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 to be executed Parameters: con - the connection the query is to be executed against throws: SQLException - if there is a problem executing the query. |
|
|