|
Isis Developer Reference
|
Go to the documentation of this file.
17 #include <QSqlDatabase>
80 Database(
const QString &connName,
const QString &driverType);
102 static void remove(
const QString &name);
111 const QString &driverType =
"");
115 static QString _actualConnectionName;
120 void tossDbError(
const QString &message,
const char *f,
int l)
const;
bool isPersistant() const
Checks persistancy state of a database instantiation.
Definition: Database.cpp:207
QSqlDatabase create(const QString &driver, const QString &dbname)
Create a database using the named driver.
Definition: DatabaseFactory.cpp:358
QString Name() const
Returns the name of this property.
Definition: DbProfile.h:104
void setDefault(const QString &name)
Sets the default name of the database.
Definition: DatabaseFactory.h:258
bool exists(const QString &key) const
Checks for the existance of a keyword.
Definition: DbProfile.h:115
@ Connect
Connect to database immediately.
Definition: Database.h:74
static DbProfile getProfile(const QString &name)
Retrieves the named database access profile.
Definition: Database.cpp:312
static void remove(const QString &name)
Removes the named database from pool.
Definition: Database.cpp:254
DbProfile getProfile(const QString &name="") const
Get the specified database access profile.
Definition: DatabaseFactory.cpp:235
void remove(const QString &dbname)
Removes the database from the connection pool.
Definition: DatabaseFactory.cpp:450
QSqlDatabase init(const DbProfile &profile, Access dbConn=Connect)
Create and initialize a new database connection from a DbProfile.
Definition: Database.cpp:403
bool isPersistant(const QString &name) const
Checks if the database resource is persistant.
Definition: DatabaseFactory.cpp:335
void destroy(const QString &dbname)
Removes the database from the connection pool and destroys it.
Definition: DatabaseFactory.cpp:435
QStringList getViews() const
Returns a vector string containing all views within the database.
Definition: Database.cpp:524
static bool addAccessConfig(const QString &confFile)
Adds a user specifed access configuration file to system.
Definition: Database.cpp:275
bool isAvailable(const QString &dbname="") const
Check for availablity of a database connection resource.
Definition: DatabaseFactory.cpp:297
void configureAccess(QSqlDatabase &db, const DbProfile &profile)
Set access parameters from a database DbProfile access specification.
Definition: Database.cpp:455
void makePersistant()
Makes this instance persistant.
Definition: Database.cpp:191
void add(const QSqlDatabase &db, const QString &name, bool setAsDefault=false)
Adds the database to the connection pool making it persistant.
Definition: DatabaseFactory.cpp:415
QString Name() const
Return the name of this database as specifed upon creation.
Definition: Database.h:90
virtual ~Database()
Database destructor.
Definition: Database.cpp:160
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
bool addAccessProfile(const QString &profileFile)
Establishes an access profile for subsequent database connections.
Definition: DatabaseFactory.cpp:152
bool isValid() const
Reports if this is a valid profile.
Definition: DbProfile.h:77
Database clone(const QString &name) const
Clones this database into another giving it another name.
Definition: Database.cpp:499
A DbProfile is a container for access parameters to a database.
Definition: DbProfile.h:51
Isis exception class.
Definition: IException.h:91
@ DoNotConnect
Do not connect to database.
Definition: Database.h:75
void setAsDefault()
Sets this database connection/profile as the default.
Definition: Database.cpp:226
Create database interfaces using access profiles or generic drivers.
Definition: DatabaseFactory.h:244
QStringList getSystemTables() const
Returns vector strings of all available system tables in the database.
Definition: Database.cpp:536
static DatabaseFactory * getInstance()
Returns and instance of this DatabaseFactory singleton.
Definition: DatabaseFactory.cpp:124
QStringList getTables() const
Returns a vector string containing all the tables in the database.
Definition: Database.cpp:511
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Namespace for the standard library.
Isis database class providing generalized access to a variety of databases.
Definition: Database.h:70
QString getDefault() const
Returns the name of the default database.
Definition: DatabaseFactory.h:271
Access
Access status for database creation.
Definition: Database.h:73
Database()
Default database constructor.
Definition: Database.cpp:33
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126