public class AppDatabase
extends java.lang.Object
getInstance()
method. It is a singleton
and no new instances can be created. Every database is described as a super class of the
Database
classDatabase
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
getConnection(Database db)
Obtains a connection to the database.
|
static AppDatabase |
getInstance()
Gets the single instance of AppDatabase.
|
static void |
shutdown()
shutdown all opened databases.
|
void |
shutdown(Database db)
Shutdowns a database.
|
public static void shutdown()
public static AppDatabase getInstance()
public java.sql.Connection getConnection(Database db)
Database
class and shall also be singletons
Remember to close the database connection in the same method where the connection is obtained
db
- the database to open a connection withpublic void shutdown(Database db)
db
- the dbCopyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa