#include <sqlitedataprovider.h>

Public Member Functions | |
| SqLiteDataProvider (void) throw () | |
| Constructor. | |
| ~SqLiteDataProvider (void) throw () | |
| Destructor. | |
| DbBackends | getDbBackend (void) const throw () |
| Get the name of the database backend. | |
| void | connect () |
| Create a connection to the database. | |
| const RecordSet & | execSql (const std::string &sql, const bool refresh=false) |
| Execute a SQL query. | |
| void | disconnect (void) |
| Close the connection to the database. | |
| void | beginTransaction (void) throw (std::runtime_error) |
| Starts a transaction. | |
| void | commitTransaction (void) throw (std::runtime_error) |
| Commits a transaction. | |
| void | rollbackTransaction (void) throw (std::runtime_error) |
| Rollback a transaction. | |
| const unsigned int | getModifiedRows (void) const |
| Returns the number of changed rows by the last executed SQL statement. | |
| const unsigned int | getLastId (void) const |
| Returns the last inserted value of an autoincrement column after an INSERT statement. | |
Definition at line 45 of file sqlitedataprovider.h.
| DbBackends dal::SqLiteDataProvider::getDbBackend | ( | void | ) | const throw () [virtual] |
Get the name of the database backend.
Implements dal::DataProvider.
Definition at line 72 of file sqlitedataprovider.cpp.
| void dal::SqLiteDataProvider::connect | ( | void | ) | [virtual] |
Create a connection to the database.
| DbConnectionFailure | if unsuccessful connection. |
Implements dal::DataProvider.
Definition at line 83 of file sqlitedataprovider.cpp.
References dal::DataProvider::mDbName, and dal::DataProvider::mIsConnected.
| const RecordSet & dal::SqLiteDataProvider::execSql | ( | const std::string & | sql, | |
| const bool | refresh = false | |||
| ) | [virtual] |
Execute a SQL query.
| sql | the SQL query. | |
| refresh | if true, refresh the cache (default = false). |
| DbSqlQueryExecFailure | if unsuccessful execution. | |
| std::runtime_error | if trying to query a closed database. |
Implements dal::DataProvider.
Definition at line 122 of file sqlitedataprovider.cpp.
References dal::RecordSet::add(), dal::RecordSet::clear(), dal::DataProvider::mIsConnected, dal::DataProvider::mRecordSet, dal::DataProvider::mSql, and dal::RecordSet::setColumnHeaders().
Referenced by beginTransaction(), commitTransaction(), and rollbackTransaction().
| void dal::SqLiteDataProvider::disconnect | ( | void | ) | [virtual] |
Close the connection to the database.
| DbDisconnectionFailure | if unsuccessful disconnection. |
Implements dal::DataProvider.
Definition at line 195 of file sqlitedataprovider.cpp.
References dal::DataProvider::isConnected(), and dal::DataProvider::mIsConnected.
Referenced by ~SqLiteDataProvider().
| void dal::SqLiteDataProvider::beginTransaction | ( | void | ) | throw (std::runtime_error) [virtual] |
Starts a transaction.
| std::runtime_error | if a transaction is still open |
Implements dal::DataProvider.
Definition at line 212 of file sqlitedataprovider.cpp.
References execSql(), dal::DataProvider::mIsConnected, and dal::DbException::what().
| void dal::SqLiteDataProvider::commitTransaction | ( | void | ) | throw (std::runtime_error) [virtual] |
Commits a transaction.
| std::runtime_error | if no connection is currently open. |
Implements dal::DataProvider.
Definition at line 247 of file sqlitedataprovider.cpp.
References execSql(), dal::DataProvider::mIsConnected, and dal::DbException::what().
| void dal::SqLiteDataProvider::rollbackTransaction | ( | void | ) | throw (std::runtime_error) [virtual] |
Rollback a transaction.
| std::runtime_error | if no connection is currently open. |
Implements dal::DataProvider.
Definition at line 282 of file sqlitedataprovider.cpp.
References execSql(), dal::DataProvider::mIsConnected, and dal::DbException::what().
| const unsigned int dal::SqLiteDataProvider::getModifiedRows | ( | void | ) | const [virtual] |
Returns the number of changed rows by the last executed SQL statement.
Implements dal::DataProvider.
Definition at line 317 of file sqlitedataprovider.cpp.
References dal::DataProvider::mIsConnected.
| const unsigned int dal::SqLiteDataProvider::getLastId | ( | void | ) | const [virtual] |
Returns the last inserted value of an autoincrement column after an INSERT statement.
Implements dal::DataProvider.
Definition at line 356 of file sqlitedataprovider.cpp.
References dal::DataProvider::mIsConnected.
1.5.5