Class OSHDBH2

  • All Implemented Interfaces:
    AutoCloseable

    public class OSHDBH2
    extends OSHDBJdbc
    OSHDB database backend connector to a H2 database.
    • Method Detail

      • inMemory

        public OSHDBH2 inMemory​(boolean cache)
                         throws SQLException
        Creates an in-memory copy of the current oshdb data (using a volatile in-memory H2 database), for faster subsequent queries.

        The original database connection will be closed during this process.

        Note that once the data has been cached in memory, this cannot be undone anymore by calling this method like `.inMemory(false)`.

        Parameters:
        cache - wether in-memory caching should be activated or not
        Returns:
        an OSHDBDatabase using the cached in-memory copy of the oshdb data
        Throws:
        SQLException - if there's a problem while copying the data into memory