Changeset 598
- Timestamp:
- 07/30/06 01:00:38 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nepenthes/trunk/nepenthes-core/include/SQLHandler.hpp
r594 r598 44 44 class SQLHandler 45 45 { 46 public:46 public: 47 47 virtual ~SQLHandler(){}; 48 49 virtual bool Init()=0; 50 virtual bool Exit()=0; 48 51 49 52 virtual bool runQuery(SQLQuery *query)=0; nepenthes/trunk/nepenthes-core/include/SQLHandlerFactory.hpp
r594 r598 50 50 } 51 51 52 virtual SQLHandler *createSQLHandler(string user, string passwd, string table, string options)=0;52 virtual SQLHandler *createSQLHandler(string server, string user, string passwd, string table, string options)=0; 53 53 54 54 protected: nepenthes/trunk/nepenthes-core/include/SQLManager.hpp
r594 r598 58 58 virtual bool registerSQLHandlerFactory(SQLHandlerFactory * handlerfactory); 59 59 virtual void unregisterSQLHandlerFactory(const char *dbtype); 60 virtual SQLHandler *createSQLHandler(const char *dbtype, string user, string passwd, string table, string options);60 virtual SQLHandler *createSQLHandler(const char *dbtype, string server, string user, string passwd, string table, string options); 61 61 62 62 private: nepenthes/trunk/nepenthes-core/src/SQLManager.cpp
r594 r598 88 88 } 89 89 90 SQLHandler *SQLManager::createSQLHandler(const char *dbtype, string user, string passwd, string table, string options)90 SQLHandler *SQLManager::createSQLHandler(const char *dbtype, string server, string user, string passwd, string table, string options) 91 91 { 92 92 list <SQLHandlerFactory *>::iterator it; … … 96 96 if (dbtype == (*it)->getDBType()) 97 97 { 98 SQLHandler *sqlh = (*it)->createSQLHandler(user,passwd,table,options); 99 return sqlh; 98 SQLHandler *sqlh = (*it)->createSQLHandler(server, user,passwd,table,options); 99 if (sqlh->Init() == true) 100 { 101 return sqlh; 102 }else 103 { 104 return NULL; 105 } 100 106 } 101 107 }
