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.
-
Constructor Details
-
DBController
public DBController()
-
-
Method Details
-
getConnection
public static java.sql.Connection getConnection() throws java.sql.SQLExceptionEstablish 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
-