Class DBController

java.lang.Object
lukas.wais.smart.mirror.controller.DBController
Direct Known Subclasses:
DBControllerPerson, DBControllerWidget, TableToXML

public class DBController
extends java.lang.Object
The Class DBController creates the connection to the database.
Author:
Omar Duenas
  • Constructor Summary

    Constructors 
    Constructor Description
    DBController()  
  • Method Summary

    Modifier and Type Method Description
    static java.sql.Connection getConnection()
    Establish the connection to the database.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getConnection

      public static java.sql.Connection getConnection() throws java.sql.SQLException
      Establish the connection to the database. This class will be extended by multiple controllers and with this method we avoid code duplication in other classes.
      Returns:
      the connection to the H2 database
      Throws:
      java.sql.SQLException - the SQL exception in case something went run while establishing a connection