00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef RESOURCEPOOL_MYSQL_FACTORY_HH
00026 #define RESOURCEPOOL_MYSQL_FACTORY_HH
00027
00028 #ifndef RESOURCEPOOL_MYSQL_RESOURCE_HH
00029 #include "Resource.hh"
00030 #endif
00031
00032 #include "ResourcePool/SQL/SQLFactoryInterface.hh"
00033
00034 #include <string>
00035
00036 namespace fatalmind {
00037
00038 class mysqlFactory : public SQL::SQLFactoryInterface {
00039 typedef SQL::SQLFactoryInterface super;
00040 public:
00041 mysqlFactory(const std::string& host
00042 , const std::string& user
00043 , const std::string& pass
00044 , const std::string& db
00045 , unsigned int port = 3306
00046 , const std::string& sock = ""
00047 );
00048 mysqlFactory(const std::string& connect);
00049
00050 using super::databaseType_t;
00051 databaseType_t getDatabaseType() const {
00052 #ifdef HAVE_MYSQL_TRANSACTIONS
00053 return MYSQLTX;
00054 #else
00055 return MYSQL;
00056 #endif
00057 };
00058
00059 mysqlResource* create_resource() const;
00060
00061 protected:
00062 virtual Clone* DoClone() const;
00063
00064 private:
00065 std::string _host;
00066 std::string _user;
00067 std::string _pass;
00068 std::string _db;
00069 unsigned int _port;
00070 const std::string _sock;
00071 };
00072
00073 }
00074 #endif