Dependents:   MySQLClientExample MySQLClientExampleMA

Embed: (wiki syntax)

« Back to documentation index

MySQLClient Class Reference

MySQLClient Class Reference

A MySQL Client. More...

#include <MySQLClient.h>

Public Member Functions

 MySQLClient ()
 Instantiates the MySQL client.
MySQLResult open (Host &host, const string &user, const string &password, const string &db, void(*pMethod)(MySQLResult))
 Opens a connection to a server.
template<class T >
MySQLResult open (Host &host, const string &user, const string &password, const string &db, T *pItem, void(T::*pMethod)(MySQLResult))
 Opens a connection to a server.
MySQLResult sql (string &sqlCommand)
 Executes an SQL command.
MySQLResult exit ()
 Closes the connection to the server.
void setTimeout (int ms)
 Setups timeout.
 MySQLClient ()
 Instantiates the MySQL client.
MySQLResult open (Host &host, const string &user, const string &password, const string &db, void(*pMethod)(MySQLResult))
 Opens a connection to a server.
template<class T >
MySQLResult open (Host &host, const string &user, const string &password, const string &db, T *pItem, void(T::*pMethod)(MySQLResult))
 Opens a connection to a server.
MySQLResult sql (string &sqlCommand)
 Executes an SQL command.
MySQLResult exit ()
 Closes the connection to the server.
void setTimeout (int ms)
 Setups timeout.

Detailed Description

A MySQL Client.

This MySQL client implements a limited subset of the MySQL internal client/server protocol (including authentication), for server versions 4.1 and newer.

Definition at line 64 of file LPC1768/services/mysql/MySQLClient.h.


Constructor & Destructor Documentation

MySQLClient (  )

Instantiates the MySQL client.

MySQLClient (  )

Instantiates the MySQL client.


Member Function Documentation

MySQLResult exit (  )

Closes the connection to the server.

MySQLResult exit (  )

Closes the connection to the server.

MySQLResult open ( Host &  host,
const string &  user,
const string &  password,
const string &  db,
T *  pItem,
void(T::*)(MySQLResult pMethod 
)

Opens a connection to a server.

Opens a connection to the server host using the provided username, password passowrd and selecting database On completion of this call (and any further one), the callback set in parameter is fired with the result of that command in parameter

Parameters:
host: server
user: username
db: database to use
pItem: callback's class instance
pMethod: callback's method to call on each request completion

Definition at line 95 of file LPC1768/services/mysql/MySQLClient.h.

MySQLResult open ( Host &  host,
const string &  user,
const string &  password,
const string &  db,
void(*)(MySQLResult pMethod 
)

Opens a connection to a server.

Opens a connection to the server host using the provided username, password passowrd and selecting database On completion of this call (and any further one), the callback set in parameter is fired with the result of that command in parameter

Parameters:
host: server
user: username
db: database to use
pMethod: callback to call on each request completion
MySQLResult open ( Host &  host,
const string &  user,
const string &  password,
const string &  db,
void(*)(MySQLResult pMethod 
)

Opens a connection to a server.

Opens a connection to the server host using the provided username, password passowrd and selecting database On completion of this call (and any further one), the callback set in parameter is fired with the result of that command in parameter

Parameters:
host: server
user: username
db: database to use
pMethod: callback to call on each request completion
MySQLResult open ( Host &  host,
const string &  user,
const string &  password,
const string &  db,
T *  pItem,
void(T::*)(MySQLResult pMethod 
)

Opens a connection to a server.

Opens a connection to the server host using the provided username, password passowrd and selecting database On completion of this call (and any further one), the callback set in parameter is fired with the result of that command in parameter

Parameters:
host: server
user: username
db: database to use
pItem: callback's class instance
pMethod: callback's method to call on each request completion

Definition at line 95 of file LPC2368/services/mysql/MySQLClient.h.

void setTimeout ( int  ms )

Setups timeout.

Parameters:
ms: time of connection inactivity in ms after which the request should timeout
void setTimeout ( int  ms )

Setups timeout.

Parameters:
ms: time of connection inactivity in ms after which the request should timeout
MySQLResult sql ( string &  sqlCommand )

Executes an SQL command.

Executes an SQL request on the SQL server This is a non-blocking function On completion, the callback set in the open function is fired with the result of the command in parameter

Parameters:
sqlCommandSQL request to execute
MySQLResult sql ( string &  sqlCommand )

Executes an SQL command.

Executes an SQL request on the SQL server This is a non-blocking function On completion, the callback set in the open function is fired with the result of the command in parameter

Parameters:
sqlCommandSQL request to execute