DatabaseManager

com.j0h1.contour.server

## Class DatabaseManager

- java.lang.Object
- - com.j0h1.contour.server.DatabaseManager

-     public class DatabaseManager
      extends java.lang.Object

  Singleton class to handle HSQLDB database access.
  Author:
    Johannes Riedmann

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.sql.Connection` | `connection`
    `private static DatabaseManager` | `dbm`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `DatabaseManager()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeConnection()` Closes connection to database.
    `java.sql.Connection` | `getConnection()`
    `static DatabaseManager` | `getInstance()` Creates/returns existing instance of DatabaseManager.
    `void` | `openConnection()` Opens a connection to HSQLDB-Database.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### dbm

          private static DatabaseManager dbm

    - #### connection

          private java.sql.Connection connection

  - ### Constructor Detail

    - #### DatabaseManager

          protected DatabaseManager()

  - ### Method Detail

    - #### getInstance

          public static DatabaseManager getInstance()

      Creates/returns existing instance of DatabaseManager.
      Returns:
        Instance of DatabaseManager.

    - #### openConnection

          public void openConnection()

      Opens a connection to HSQLDB-Database.

    - #### getConnection

          public java.sql.Connection getConnection()

    - #### closeConnection

          public void closeConnection()

      Closes connection to database.