Public Member Functions | |
DatabaseMySQL () | |
~DatabaseMySQL () | |
void | connect (const std::string &server, const std::string &username, const std::string &password, const std::string &dbname) |
void | execute (const std::string &statement) |
dbfacade::ResultPtr | sqlSelect (const std::string &statement, const bool allAtOnce=true) |
int | sqlInsert (const std::string &statement) |
int | sqlUpdate (const std::string &statement) |
std::string | escape (const char *unescaped, const int size) const |
DatabaseMySQL::DatabaseMySQL | ( | ) | [inline] |
DatabaseMySQL::~DatabaseMySQL | ( | ) | [inline] |
void DatabaseMySQL::connect | ( | const std::string & | server, | |
const std::string & | username, | |||
const std::string & | password, | |||
const std::string & | dbname | |||
) | [inline, virtual] |
Establishes a connection to a database.
Implements dbfacade::Database.
void DatabaseMySQL::execute | ( | const std::string & | statement | ) | [inline, virtual] |
Called by sqlSelect, sqlInsert and sqlUpdate.
Implements dbfacade::Database.
dbfacade::ResultPtr DatabaseMySQL::sqlSelect | ( | const std::string & | statement, | |
const bool | allAtOnce = true | |||
) | [inline, virtual] |
Returns the result of the select statement.
Implements dbfacade::Database.
int DatabaseMySQL::sqlInsert | ( | const std::string & | statement | ) | [inline, virtual] |
MySQL:
Implements dbfacade::Database.
int DatabaseMySQL::sqlUpdate | ( | const std::string & | statement | ) | [inline, virtual] |
Returns the number of affected rows.
Implements dbfacade::Database.
std::string DatabaseMySQL::escape | ( | const char * | unescaped, | |
const int | size | |||
) | const [inline, virtual] |
Replaces characters by escape sequences.
Implements dbfacade::Database.