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 DatabaseManagerpublic int setPreferences()
setPreferences in interface DatabaseManagerpublic Status close()
close in interface DatabaseManagerpublic Connection getCon()
getCon in interface DatabaseManagerpublic boolean checkDBFile()
throws IOException
DatabaseManagercheckDBFile in interface DatabaseManagerIOException - in case an exception occurs handling the file.public void setDatabaseLocal()
setDatabaseLocal in interface DatabaseManagerpublic void setDatabaseRemote()
setDatabaseRemote in interface DatabaseManagerpublic String getDatabaseHost()
getDatabaseHost in interface DatabaseManagerpublic boolean setMySQLparameters(String host, String user, String pass, String db)
setMySQLparameters in interface DatabaseManagerpublic String setDBFolder()
DatabaseManagersetDBFolder in interface DatabaseManagerCopyright © 2019. All rights reserved.