From 10dfdd74bc67a72ce969896cc2698662e2b7afb7 Mon Sep 17 00:00:00 2001 From: Huynh Tran Date: Tue, 14 Jun 2005 19:57:45 +0000 Subject: Reworked RecordSet and implemented the SQLite Data Provider --- src/dal/dataprovider.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'src/dal/dataprovider.h') diff --git a/src/dal/dataprovider.h b/src/dal/dataprovider.h index b5542e49..4b3f2ecf 100644 --- a/src/dal/dataprovider.h +++ b/src/dal/dataprovider.h @@ -110,10 +110,31 @@ class DataProvider std::exception) = 0; + /** + * 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. + */ + virtual void + connect(const std::string& dbName, + const std::string& dbPath, + const std::string& userName, + const std::string& password) + throw(DbConnectionFailure, + std::exception) = 0; + + /** * Execute a SQL query. * * @param sql the SQL query. + * @param refresh if true, refresh the cache (optional) * * @return a recordset. * @@ -121,7 +142,8 @@ class DataProvider * @exception std::exception if unexpected exception. */ virtual const RecordSet& - execSql(const std::string& sql) + execSql(const std::string& sql, + const bool refresh = false) throw(DbSqlQueryExecFailure, std::exception) = 0; @@ -149,6 +171,18 @@ class DataProvider protected: + /** + * The database name. + */ + std::string mDbName; + + + /** + * The database path. + */ + std::string mDbPath; + + /** * The connection status. */ -- cgit v1.2.3-60-g2f50