DatabaseMySQL Class Reference

Inheritance diagram for DatabaseMySQL:

Inheritance graph
Collaboration diagram for DatabaseMySQL:

Collaboration graph

List of all members.

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

Constructor & Destructor Documentation

DatabaseMySQL::DatabaseMySQL (  )  [inline]

DatabaseMySQL::~DatabaseMySQL (  )  [inline]

Member Function Documentation

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.

Here is the caller graph for this function:

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]


  • Returns the first automatically generated AUTO_INCREMENT value (or the AUTO_INCREMENT value of the previously inserted row or 0 if there isn't one).
  • Throws an exception if VARCHARs are too long. PostgreSQL:
  • Returns the inserted OID (or 0 if no the table has no OIDs).
  • Truncates VARCHARs that are too long.

Implements dbfacade::Database.

Here is the call graph for this function:

int DatabaseMySQL::sqlUpdate ( const std::string &  statement  )  [inline, virtual]

Returns the number of affected rows.

Implements dbfacade::Database.

Here is the call graph for this function:

std::string DatabaseMySQL::escape ( const char *  unescaped,
const int  size 
) const [inline, virtual]

Replaces characters by escape sequences.

Implements dbfacade::Database.

The documentation for this class was generated from the following file:

Generated on Mon Mar 16 20:04:32 2009 for by  doxygen 1.5.5