-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDBConnectionFactory.h
More file actions
35 lines (26 loc) · 991 Bytes
/
DBConnectionFactory.h
File metadata and controls
35 lines (26 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __DBCONNECTIONFACTORY_H__
#define __DBCONNECTIONFACTORY_H__
#include "DBConnection.h"
#include <string>
using namespace std;
//*******************************************************************
// Factory responsible for creating database connections. Each connection
// this factory creates will be a descendant of DBConnection - allowing
// for a single "interface" association. Creation happens by providing this
// factory a connection type and based on the connection type it
// knows the specific subclass to create.
//
// This class is a singleton
class DBConnectionFactory
{
public:
static DBConnectionFactory& getInstance();
~DBConnectionFactory(void);
virtual DBConnection* createConnection(const string& poolName);
virtual void releaseConnection(DBConnection* connection);
static const string ORACLE_CONNECTION;
private:
DBConnectionFactory(void);
static DBConnectionFactory* s_instance;
};
#endif