public class DatabaseManagerImpl extends Object implements DatabaseManager
Modifier and Type | Method and Description |
---|---|
boolean |
checkDBFile()
Checks for presence of database file in defined
folder and downloads it if not present
|
Status |
close()
Closes the database connection.
|
Connection |
getCon()
Gets the connection to the database.
|
String |
getDatabaseHost() |
static DatabaseManagerImpl |
getInstance()
Singleton implementation of the database class.
|
Status |
init()
Initializes the database connection.
|
void |
setDatabaseLocal() |
void |
setDatabaseRemote() |
String |
setDBFolder()
Allows to change the preference settings for the
database folder
|
boolean |
setMySQLparameters(String host,
String user,
String pass,
String db) |
int |
setPreferences()
Sets the parameters for the database connection.
|
public static DatabaseManagerImpl getInstance()
public Status init()
init
in interface DatabaseManager
public int setPreferences()
setPreferences
in interface DatabaseManager
public Status close()
close
in interface DatabaseManager
public Connection getCon()
getCon
in interface DatabaseManager
public boolean checkDBFile() throws IOException
DatabaseManager
checkDBFile
in interface DatabaseManager
IOException
- in case an exception occurs handling the file.public void setDatabaseLocal()
setDatabaseLocal
in interface DatabaseManager
public void setDatabaseRemote()
setDatabaseRemote
in interface DatabaseManager
public String getDatabaseHost()
getDatabaseHost
in interface DatabaseManager
public boolean setMySQLparameters(String host, String user, String pass, String db)
setMySQLparameters
in interface DatabaseManager
public String setDBFolder()
DatabaseManager
setDBFolder
in interface DatabaseManager
Copyright © 2021. All rights reserved.