java.lang.Object
edu.ntnu.idatt1002.k1g4.dao.Database
Class used to create Database connection
- Version:
- 0.1
- Author:
- Callum Gran
-
Constructor Details
-
Database
public Database()
-
-
Method Details
-
instance
Checks if there is an existing instance of Database. If not, it creates one.- Returns:
- database Database: An instance of Database, either the existing one, or a newly created one.
-
getConnection
Method to get a connection from the Database object.- Returns:
- Connection: A connection to the Database object.
- Throws:
SQLException
- if failing to get connection
-