#include <mmsdbfreetds.h>
Public Member Functions | |
MMSDBFreeTDS (DataSource *datasource) | |
Constructor which only saves a reference to the given DataSource object. | |
virtual | ~MMSDBFreeTDS () |
Destructor which disconnects from the database. | |
void | connect () |
Opens connection to the database. | |
void | disconnect () |
Close connection to database if a connection was established before. | |
void | startTransaction () |
Method not implemented since the FreeTDS implementation does not support transactions. | |
void | commitTransaction () |
Method not implemented since the FreeTDS implementation does not support transactions. | |
void | rollbackTransaction () |
Method not implemented since the FreeTDS implementation does not support transactions. | |
int | query (string statement, MMSRecordSet *rs) |
This function executes the given database query and puts the results in MMSRecordSet. | |
int | query (string statement) |
This function executes given database query. | |
int | executeSP (string spName, MMSDB_SP_ARGLIST argList, MMSRecordSet *rs) |
This function executes given stored procedure and puts the results in MMSRecordSet. | |
int | executeSP (string spName, MMSDB_SP_ARGLIST argList) |
This function executes a stored procedure. | |
int | getLastInsertedID () |
This method is not supported by the FreeTDS implementation. | |
Private Member Functions | |
int | query (string statement, SQLHSTMT &hstmt, bool finishStatement=true) |
Internal function to execute a given database query. | |
Private Attributes | |
SQLHDBC * | dbhandle |
Database handle retrieved in connect(). | |
SQLHENV | henv |
Database environment handle retrieved in connect(). | |
DataSource * | datasource |
Database configuration. |
This allows usage of Microsoft SQL Server and Sybase database backends. MMSDBFreeTDS implementes the IMMSDB interface, which should be used in your application to provide simple database backend exchange by only changing the configuration in your XML-configuration file.
Definition at line 73 of file mmsdbfreetds.h.
MMSDBFreeTDS::MMSDBFreeTDS | ( | DataSource * | datasource | ) |
Constructor which only saves a reference to the given DataSource object.
datasource | Database configuration to use. |
MMSError | datasource was NULL |
Definition at line 48 of file mmsdbfreetds.cpp.
MMSDBFreeTDS::~MMSDBFreeTDS | ( | ) | [virtual] |
Destructor which disconnects from the database.
Definition at line 58 of file mmsdbfreetds.cpp.
void MMSDBFreeTDS::connect | ( | ) | [virtual] |
Opens connection to the database.
The database settings have to be given to the constructor before.
MMSError | Connection to SQL database could not be established (for detailed information use MMSError::getMessage()) |
Implements IMMSDB.
Definition at line 89 of file mmsdbfreetds.cpp.
void MMSDBFreeTDS::disconnect | ( | ) | [virtual] |
Close connection to database if a connection was established before.
Implements IMMSDB.
Definition at line 135 of file mmsdbfreetds.cpp.
void MMSDBFreeTDS::startTransaction | ( | ) | [inline, virtual] |
Method not implemented since the FreeTDS implementation does not support transactions.
Implements IMMSDB.
Definition at line 118 of file mmsdbfreetds.h.
void MMSDBFreeTDS::commitTransaction | ( | ) | [inline, virtual] |
Method not implemented since the FreeTDS implementation does not support transactions.
Implements IMMSDB.
Definition at line 124 of file mmsdbfreetds.h.
void MMSDBFreeTDS::rollbackTransaction | ( | ) | [inline, virtual] |
Method not implemented since the FreeTDS implementation does not support transactions.
Implements IMMSDB.
Definition at line 130 of file mmsdbfreetds.h.
int MMSDBFreeTDS::query | ( | string | statement, | |
MMSRecordSet * | rs | |||
) | [virtual] |
This function executes the given database query and puts the results in MMSRecordSet.
This method is used for select statements.
statement | buffer with database query | |
rs | recordset containing result of query |
MMSError | SQL query could not be executed (for detailed information use MMSError::getMessage()) |
Implements IMMSDB.
Definition at line 151 of file mmsdbfreetds.cpp.
int MMSDBFreeTDS::query | ( | string | statement | ) | [virtual] |
This function executes given database query.
This method is used for insert, update and delete statements.
statement | buffer with database query |
MMSError | SQL query could not be executed (for detailed information use MMSError::getMessage()) |
Implements IMMSDB.
Definition at line 207 of file mmsdbfreetds.cpp.
int MMSDBFreeTDS::executeSP | ( | string | spName, | |
MMSDB_SP_ARGLIST | argList, | |||
MMSRecordSet * | rs | |||
) |
This function executes given stored procedure and puts the results in MMSRecordSet.
This method is used for insert, update and delete statements
spName | name of stored procedure | |
argList | arguments for stored procedure | |
rs | recordset containing result |
Definition at line 239 of file mmsdbfreetds.cpp.
int MMSDBFreeTDS::executeSP | ( | string | spName, | |
MMSDB_SP_ARGLIST | argList | |||
) |
This function executes a stored procedure.
This method is used for insert, update and delete statements
spName | name of stored procedure | |
argList | arguments for stored procedure |
Definition at line 258 of file mmsdbfreetds.cpp.
int MMSDBFreeTDS::getLastInsertedID | ( | ) | [inline, virtual] |
This method is not supported by the FreeTDS implementation.
Implements IMMSDB.
Definition at line 194 of file mmsdbfreetds.h.
int MMSDBFreeTDS::query | ( | string | statement, | |
SQLHSTMT & | hstmt, | |||
bool | finishStatement = true | |||
) | [private] |
Internal function to execute a given database query.
This method is used by the public query() methods.
statement | buffer with database query | |
hstmt | reference to SQL statement handle | |
finishStatement | if false query cursor stays open i.e. to call SqlFetch() afterwards |
MMSError | SQL query could not be executed (for detailed information use MMSError::getMessage()) |
Definition at line 213 of file mmsdbfreetds.cpp.
SQLHDBC* MMSDBFreeTDS::dbhandle [private] |
SQLHENV MMSDBFreeTDS::henv [private] |
DataSource* MMSDBFreeTDS::datasource [private] |