Changeset 598

Show
Ignore:
Timestamp:
07/30/06 01:00:38 (2 years ago)
Author:
common
Message:

nepenthes

  • sqlinterface adjustments
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/nepenthes-core/include/SQLHandler.hpp

    r594 r598  
    4444        class SQLHandler 
    4545        { 
    46                public: 
     46        public: 
    4747                virtual ~SQLHandler(){}; 
     48 
     49                virtual bool Init()=0; 
     50                virtual bool Exit()=0; 
    4851 
    4952                virtual bool runQuery(SQLQuery *query)=0; 
  • nepenthes/trunk/nepenthes-core/include/SQLHandlerFactory.hpp

    r594 r598  
    5050                } 
    5151 
    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; 
    5353                 
    5454        protected: 
  • nepenthes/trunk/nepenthes-core/include/SQLManager.hpp

    r594 r598  
    5858                virtual bool registerSQLHandlerFactory(SQLHandlerFactory * handlerfactory); 
    5959                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); 
    6161 
    6262        private: 
  • nepenthes/trunk/nepenthes-core/src/SQLManager.cpp

    r594 r598  
    8888} 
    8989 
    90 SQLHandler *SQLManager::createSQLHandler(const char *dbtype, string user, string passwd, string table, string options) 
     90SQLHandler *SQLManager::createSQLHandler(const char *dbtype, string server, string user, string passwd, string table, string options) 
    9191{ 
    9292        list <SQLHandlerFactory *>::iterator it; 
     
    9696                if (dbtype == (*it)->getDBType()) 
    9797                { 
    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                        } 
    100106                } 
    101107        }