diff options
author | Huynh Tran <nthuynh75@gmail.com> | 2005-06-14 19:57:45 +0000 |
---|---|---|
committer | Huynh Tran <nthuynh75@gmail.com> | 2005-06-14 19:57:45 +0000 |
commit | 10dfdd74bc67a72ce969896cc2698662e2b7afb7 (patch) | |
tree | f41b086df0b1a4c9d21bcdf6c2cfe4605108c6b1 /src/dal/sqlitedataprovider.h | |
parent | 37e4f1a6e2cdf3aea39277649990f908a2d47cbc (diff) | |
download | manaserv-10dfdd74bc67a72ce969896cc2698662e2b7afb7.tar.gz manaserv-10dfdd74bc67a72ce969896cc2698662e2b7afb7.tar.bz2 manaserv-10dfdd74bc67a72ce969896cc2698662e2b7afb7.tar.xz manaserv-10dfdd74bc67a72ce969896cc2698662e2b7afb7.zip |
Reworked RecordSet and implemented the SQLite Data Provider
Diffstat (limited to 'src/dal/sqlitedataprovider.h')
-rw-r--r-- | src/dal/sqlitedataprovider.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/dal/sqlitedataprovider.h b/src/dal/sqlitedataprovider.h index 4780bfbf..f113bd54 100644 --- a/src/dal/sqlitedataprovider.h +++ b/src/dal/sqlitedataprovider.h @@ -27,6 +27,8 @@ #include <string> +#include "sqlite3.h" + #include "dataprovider.h" @@ -101,9 +103,30 @@ class SqLiteDataProvider: public DataProvider /** + * Create a connection to the database. + * + * @param dbName the database name. + * @param dbPath the database file path. + * @param userName the user name. + * @param password the user password. + * + * @exception DbConnectionFailure if unsuccessful connection. + * @exception std::exception if unexpected exception. + */ + void + connect(const std::string& dbName, + const std::string& dbPath, + const std::string& userName, + const std::string& password) + throw(DbConnectionFailure, + std::exception); + + + /** * Execute a SQL query. * * @param sql the SQL query. + * @param refresh if true, refresh the cache (optional) * * @return a recordset. * @@ -111,7 +134,8 @@ class SqLiteDataProvider: public DataProvider * @exception std::exception if unexpected exception. */ const RecordSet& - execSql(const std::string& sql) + execSql(const std::string& sql, + const bool refresh = false) throw(DbSqlQueryExecFailure, std::exception); @@ -126,6 +150,13 @@ class SqLiteDataProvider: public DataProvider disconnect(void) throw(DbDisconnectionFailure, std::exception); + + + private: + /** + * The database. + */ + sqlite3* mDb; }; |