-
Notifications
You must be signed in to change notification settings - Fork 2
/
db-mysql.h
79 lines (62 loc) · 1.17 KB
/
db-mysql.h
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
75
76
77
78
79
#ifndef DB_MYSQL_H
#define DB_MYSQL_H 1
#include "db-intf.h"
#include <mysql/mysql.h>
/**
*/
class DatabaseMySQL : public DatabaseIntf
{
public:
MYSQL *db;
DatabaseMySQL();
~DatabaseMySQL();
virtual int open(
const std::string &connection,
const std::string &login,
const std::string &password,
const std::string &db,
int port
) override;
virtual int close() override;
virtual int exec(
const std::string &statement
) override;
virtual int select(
std::vector<std::vector<std::string>> &retval,
const std::string &statement
) override;
//
// cursor
//
virtual int cursorOpen(
void **retStmt,
std::string &statement
) override;
virtual int cursorBindText(
void *stmt,
int position1,
const std::string &value
) override;
virtual int cursorColumnCount(
void *stmt
) override;
virtual std::string cursorColumnName(
void *stmt,
int column0
) override;
virtual std::string cursorColumnText(
void *stmt,
int column0
) override;
virtual DB_FIELD_TYPE cursorColumnType(
void *stmt,
int column0
) override;
virtual bool cursorNext(
void *stmt
) override;
virtual int cursorClose(
void *stmt
) override;
};
#endif