JDBCCategoryDataset
org.jfree.data.jdbc

Class JDBCCategoryDataset

    • Constructor Detail

      • JDBCCategoryDataset

        public JDBCCategoryDataset(String url,                   String driverName,                   String user,                   String passwd)                    throws ClassNotFoundException,                           SQLException
        Creates a new dataset with a database connection.
        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.
      • JDBCCategoryDataset

        public JDBCCategoryDataset(Connection connection)
        Create a new dataset with the given database connection.
        Parameters:
        connection - the database connection.
      • JDBCCategoryDataset

        public JDBCCategoryDataset(Connection connection,                   String query)                    throws SQLException
        Creates a new dataset with the given database connection, and executes the supplied query to populate the dataset.
        Parameters:
        connection - the connection.
        query - the query.
        Throws:
        SQLException - if there is a problem executing the query.
    • Method Detail

      • getTranspose

        public boolean getTranspose()
        Returns a flag that controls whether or not the table values are transposed when added to the dataset.
        Returns:
        A boolean.
      • setTranspose

        public void setTranspose(boolean transpose)
        Sets a flag that controls whether or not the table values are transposed when added to the dataset.
        Parameters:
        transpose - the flag.
      • executeQuery

        public void executeQuery(String query)                  throws SQLException
        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
        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.
        query - the query.
        Throws:
        SQLException - if there is a problem executing the query.

SCaVis 2.2 © jWork.ORG