Class HSQLProvider
java.lang.Object
net.simplace.pipe.filler.HSQLProvider
Helper for in-memory HSQL databases: connections and Gantt chart datasets from SQL queries.
- Author:
- Andreas Enders
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.jfree.data.category.IntervalCategoryDatasetgetIntervalCategoryDataset(Connection aCon, String aSql) Creates a Gantt dataset from a query with the columns task name, start date and end date (one seriesData) or task series, task name, start date and end date.static ConnectiongetMemoryConnection(String aName, String aSystemID) Creates (if necessary) a pool for the in-memory HSQL databaseaNameand returns a connection.
-
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 databaseaNameand returns a connection.- Parameters:
aName- name of the pool and the databaseaSystemID- system the pool belongs to- Returns:
- the connection, or
nullif the pool is exhausted - Throws:
SQLException- if the connection cannot be openedClassNotFoundException- 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 seriesData) 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 connectionaSql- the query- Returns:
- the task series collection
- Throws:
Exception- if the query fails or does not return 3 or 4 columns
-