#include <DBInterface.h>
Public Member Functions | |
| DBInterface () | |
| DBInterface (const char *, const char *, const char *, const char *) | |
| ~DBInterface () | |
| void | checkDatabaseConnection (mysqlpp::Connection *&conn) |
| bool | connectToDatabase (bool useEx) |
| const DBParameters | getDBParameters () |
| mysqlpp::Connection * | getNewConnection () |
| mysqlpp::Query | getQuery () |
Private Member Functions | |
| DBInterface (const DBInterface &) | |
| DBInterface | operator= (const DBInterface &) |
| bool | connectToDatabase (mysqlpp::Connection *&conn) |
Private Attributes | |
| mysqlpp::Connection * | connection |
| vector< mysqlpp::Connection * > | connectionVector |
| DBParameters | dbParam |
| bool | useExceptions |
Definition at line 47 of file DBInterface.h.
|
|
Empty default constructor - not used. Definition at line 36 of file DBInterface.cpp. |
|
||||||||||||||||||||
|
Main constructor. Definition at line 41 of file DBInterface.cpp. References DBParameters::database, dbParam, DBParameters::host, DBParameters::maxParamLength, DBParameters::password, Utilities::safeCStringCopy(), and DBParameters::user. |
|
|
Destructor. Definition at line 50 of file DBInterface.cpp. References connection, and connectionVector. |
|
|
Declare copy constructor private so it cannot be used inadvertently. |
|
|
Referenced by getQuery(). |
|
|
|
|
|
Connects to the database using the parameters stored in the constructor. Definition at line 112 of file DBInterface.cpp. References connection, and useExceptions. Referenced by getNewConnection(). |
|
|
Returns the database parameters. Mainly used for passing dbparameters to spawned processes. Definition at line 124 of file DBInterface.cpp. References dbParam. |
|
|
Creates a new connection and returns it. This is generally used for large queries, which need to use ResUse instead of Result. NOTE: Exception handling should be done by the calling class. Definition at line 132 of file DBInterface.cpp. References connectionVector, connectToDatabase(), and useExceptions. |
|
|
Returns the query from the main connection. Throws an exception if the database connection has failed and cannot be restored. Definition at line 150 of file DBInterface.cpp. References checkDatabaseConnection(), and connection. |
|
|
Declare assignment private so it cannot be used. |
|
|
Main connection to database. Used most of the time by other classes. Definition at line 63 of file DBInterface.h. Referenced by connectToDatabase(), getQuery(), and ~DBInterface(). |
|
|
Vector containing other connections to database that have been created These are generally created for large fast queries using ResUse. Definition at line 67 of file DBInterface.h. Referenced by getNewConnection(), and ~DBInterface(). |
|
|
Parameters for database connection Stored to prevent them from disappearing and to pass them on elsewhere when required. Definition at line 72 of file DBInterface.h. Referenced by DBInterface(), and getDBParameters(). |
|
|
Records whether we are using exceptions or not. Definition at line 75 of file DBInterface.h. Referenced by connectToDatabase(), and getNewConnection(). |
1.4.4