Class HSQLProvider

java.lang.Object
net.simplace.pipe.filler.HSQLProvider

public class HSQLProvider extends Object
Helper for in-memory HSQL databases: connections and Gantt chart datasets from SQL queries.
Author:
Andreas Enders
  • Constructor Details

    • HSQLProvider

      public HSQLProvider()
  • Method Details

    • getMemoryConnection

      public static Connection getMemoryConnection(String aName, String aSystemID) throws SQLException, ClassNotFoundException
      Creates (if necessary) a pool for the in-memory HSQL database aName and returns a connection.
      Parameters:
      aName - name of the pool and the database
      aSystemID - system the pool belongs to
      Returns:
      the connection, or null if the pool is exhausted
      Throws:
      SQLException - if the connection cannot be opened
      ClassNotFoundException - declared, not thrown (driver errors are logged by the pool manager)
    • getIntervalCategoryDataset

      public static org.jfree.data.category.IntervalCategoryDataset getIntervalCategoryDataset(Connection aCon, String aSql) throws Exception
      Creates a Gantt dataset from a query with the columns task name, start date and end date (one series Data) or task series, task name, start date and end date. If the start is after the end, the end is moved to the next year. Records without dates are skipped. Numeric date columns are taken as day of year of the current year.
      Parameters:
      aCon - the database connection
      aSql - the query
      Returns:
      the task series collection
      Throws:
      Exception - if the query fails or does not return 3 or 4 columns