Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DatabaseSvc.h

Go to the documentation of this file.
00001 #ifndef DATABASESVC_H
00002 #define DATABASESVC_H
00003 
00004 #include "GaudiKernel/Service.h"
00005 #include "DatabaseSvc/IDatabaseSvc.h"
00006 
00007 #include <mysql.h>
00008 
00009 class DbInterface;
00010 
00011 template <class TYPE> class SvcFactory;
00012 
00013 class DatabaseSvc : virtual public IDatabaseSvc,
00014   virtual public Service
00015 {
00016 
00017   // Allow SvcFactory to instantiate the service.
00018   friend class SvcFactory<DatabaseSvc>;
00019 
00020  protected:
00021 
00022   // Constructor
00023   DatabaseSvc( const std::string& name, ISvcLocator* sl );
00024   
00025   // Destructor
00026   virtual ~DatabaseSvc();
00027   
00028  public:
00029 
00030   // IInterface: query
00031   virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface );
00032   
00033   // Service: initialize
00034   virtual StatusCode initialize();
00035 
00036   // Service: finalize
00037   virtual StatusCode finalize();
00038 
00039   // make query 
00040   int query(const std::string& dbName, const std::string& sql);
00041   int query(const std::string& dbName, const std::string& sql, DatabaseRecordVector& res);
00042   
00043  private:
00044 
00045   DbInterface * dbInterface;  
00046   std::string m_dbName;
00047   
00048   std::string m_dbHost;
00049   std::string m_dbUser;
00050   std::string m_dbPasswd;
00051   std::string m_dbFilePath;
00052   std::string m_dbType;
00053   bool m_dbReuseConnection;
00054 };
00055 
00056 #endif

Generated on Wed Feb 2 15:41:24 2011 for BOSS6.5.5 by  doxygen 1.3.9.1