Interface for calling database client library. More...
#include <DBInterface.h>
Public Member Functions | |
| Database () | |
| Database (std::string &server, int port) | |
| Database (const Database &other) | |
| virtual | ~Database () |
| virtual bool | connect (std::string &dbname, std::string &user, std::string &password)=0 |
| virtual bool | isconnected () const =0 |
| virtual void | close ()=0 |
| virtual bool | enable_ssl (const std::string &keyfile="", const std::string &certfile="", const std::string &cafile="", const std::string &capath="")=0 |
| virtual bool | shutdown ()=0 |
Interface for calling database client library.
For different types of database client library, different classes should be implemented by implementing this interface.
| Arc::Database::Database | ( | ) | [inline] |
Default constructor
| Arc::Database::Database | ( | std::string & | server, | |
| int | port | |||
| ) | [inline] |
Constructor which uses the server's name(or IP address) and port as parametes
| Arc::Database::Database | ( | const Database & | other | ) | [inline] |
Copy constructor
| virtual Arc::Database::~Database | ( | ) | [inline, virtual] |
Deconstructor
| virtual void Arc::Database::close | ( | ) | [pure virtual] |
Close the connection with database server
Implemented in Arc::MySQLDatabase.
| virtual bool Arc::Database::connect | ( | std::string & | dbname, | |
| std::string & | user, | |||
| std::string & | password | |||
| ) | [pure virtual] |
Do connection with database server
| dbname | The database name which will be used. | |
| user | The username which will be used to access database. | |
| password | The password which will be used to access database. |
Implemented in Arc::MySQLDatabase.
| virtual bool Arc::Database::enable_ssl | ( | const std::string & | keyfile = "", |
|
| const std::string & | certfile = "", |
|||
| const std::string & | cafile = "", |
|||
| const std::string & | capath = "" | |||
| ) | [pure virtual] |
Enable ssl communication for the connection
| keyfile | The location of key file. | |
| certfile | The location of certificate file. | |
| cafile | The location of ca file. | |
| capath | The location of ca directory |
Implemented in Arc::MySQLDatabase.
| virtual bool Arc::Database::isconnected | ( | ) | const [pure virtual] |
Get the connection status
Implemented in Arc::MySQLDatabase.
| virtual bool Arc::Database::shutdown | ( | ) | [pure virtual] |
Ask database server to shutdown
Implemented in Arc::MySQLDatabase.
1.6.3