Main | License | Installation | FAQ | Screenshots | Contact | Links | Sf.net | Freshmeat.net | KDE-Apps.org
Requirements | Design | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

MySQLDatabase Class Reference
[MySQL C++ Wrappers]

#include <mysqlDatabase.hpp>

Inheritance diagram for MySQLDatabase:

Inheritance graph
[legend]

Public Member Functions

 MySQLDatabase (MySQLServerPtr _server, const std::string &_databaseName) throw (Error)
virtual ~MySQLDatabase (void)
 Destructor.
virtual StatementPtr execQuery (const std::string &query) throw (Error)
const std::string & getDatabaseName (void) const
MYSQL * getConnection (void)

Protected Attributes

MYSQL connection
std::string databaseName

Detailed Description

Connection to MySQL database.
Date:
Sun Mar 06 2005
Author:
Jan Wedekind (wedesoft@users.sourceforge.net)

Definition at line 29 of file mysqlDatabase.hpp.


Constructor & Destructor Documentation

MySQLDatabase::MySQLDatabase ( MySQLServerPtr  _server,
const std::string &  _databaseName 
) throw (Error)

Constructor connecting to a MySQL server over the network. Connect to a MySQL-server on the network.

Parameters:
_server Server-object.
_databaseName Name of MySQL-database.

Definition at line 22 of file mysqlDatabase.cpp.

00023                                                                             :
00024   Database( _server ), databaseName(_databaseName)
00025 {
00026   _server->connect( databaseName, &connection );
00027 }

MySQLDatabase::~MySQLDatabase ( void   )  [virtual]

Destructor.

Definition at line 29 of file mysqlDatabase.cpp.

References connection.

00030 {
00031   mysql_close( &connection );
00032 }


Member Function Documentation

StatementPtr MySQLDatabase::execQuery ( const std::string &  query  )  throw (Error) [virtual]

Execute single query. The returned Statement object allows requesting the results of the query.

Implements Database.

Definition at line 34 of file mysqlDatabase.cpp.

00035 {
00036   StatementPtr retVal( new MySQLStatement( this, query ) );
00037   return retVal;
00038 }

const std::string& MySQLDatabase::getDatabaseName ( void   )  const [inline]

Definition at line 43 of file mysqlDatabase.hpp.

References databaseName.

00043 { return databaseName; }

MYSQL* MySQLDatabase::getConnection ( void   )  [inline]

Definition at line 45 of file mysqlDatabase.hpp.

References connection.

Referenced by MySQLStatement::getNumCols().

00045 { return &connection; }


Field Documentation

MYSQL MySQLDatabase::connection [protected]

Definition at line 48 of file mysqlDatabase.hpp.

Referenced by getConnection(), and ~MySQLDatabase().

std::string MySQLDatabase::databaseName [protected]

Definition at line 50 of file mysqlDatabase.hpp.

Referenced by getDatabaseName().


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

anymeal 0.30 - recipe management software - Make the most of your food! - © Jan Wedekind Wed Sep 26 01:40:19 2007 - GNU Free Documentation License