-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabase.h
More file actions
74 lines (67 loc) · 2.07 KB
/
Copy pathDatabase.h
File metadata and controls
74 lines (67 loc) · 2.07 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef DATABASE
#define DATABASE
#include <stdlib.h>
#include <iostream>
#include <driver.h>
#include <exception.h>
#include <resultset.h>
#include <statement.h>
#include <prepared_statement.h>
using namespace sql;
using namespace std;
/**
* @brief This class represents the database and connects to it
*
* @author Abdulrahim Hamed (ahamed4)
* @author Braikhna Yousafzai (byousafz)
* @author Colin Stoddart (cstodda6)
* @author Evangelos Makris (emakris2)
* @author Jem Parlakyigit (mparlaky)
*/
class Database{
public:
Driver *driver;
Connection *con;
Statement *stmt;
ResultSet *res;
PreparedStatement *pstmt;
bool connectLocally;
public:
/**
* @brief Empty Database Constructor
*
* @returns A database object
* @see Database::Database(string serverName, string userName, string password);
*/
Database();
/**
* @brief Database Constructor
*
* @param serverName A string version of the server address(name)
* @param userName A string version of the server username
* @param password A string version of the server password
* @returns A database object
* @see Database::Database(string serverName, string userName, string password);
*/
Database(string serverName, string userName, string password);
/**
* @brief Database Constructor
*
* @param cond A Int representing a certian condition related to the database connection
* @param serverName A string version of the server address(name)
* @param userName A string version of the server username
* @param password A string version of the server password
* @param databaseName A string version of the database you want to connect to
* @returns A database object
* @see Database::Database(string serverName, string userName, string password);
*/
Database(int cond, string serverName, string userName, string password, string databaseName);
/**
* @brief Checks for local connection
*
* @returns A bool representing the status of the local connection
* @see Database::Database(string serverName, string userName, string password);
*/
bool getConnectLocally();
};
#endif