918-git-images-111dconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacion
Line | |
---|
1 | // ****************************************************************************************************** |
---|
2 | // Aplicación HIDRA |
---|
3 | // Copyright 2004 Jos�Manuel Alonso. Todos los derechos reservados. |
---|
4 | // Fichero: Database.h |
---|
5 | // Descripción: |
---|
6 | // Fichero de cabecera de la clase Database para implementar funciones de manipulaci� |
---|
7 | // de bases de datos sobre un Servidor Mysql |
---|
8 | // ****************************************************************************************************** |
---|
9 | #include <stdio.h> |
---|
10 | #include <stdlib.h> |
---|
11 | #include <string.h> |
---|
12 | #include </usr/include/mysql/mysql.h> |
---|
13 | // __________________________________________________________________________ |
---|
14 | class Database; |
---|
15 | class Table; |
---|
16 | // __________________________________________________________________________ |
---|
17 | class Database |
---|
18 | { |
---|
19 | public: |
---|
20 | MYSQL *m_Cnn; |
---|
21 | char m_ErrStr[500]; |
---|
22 | Database(); |
---|
23 | bool Open(char* UserName, char* Pwd,char* server,char*Database); |
---|
24 | bool OpenTbl(int Mode, char* CmdStr, Table& Tbl); |
---|
25 | bool Close(void); |
---|
26 | bool Execute(char* CmdStr); |
---|
27 | bool Execute(char* CmdStr, Table& Tbl); |
---|
28 | void liberaResult(Table& Tbl); |
---|
29 | void GetErrorErrStr(char* ErrStr); |
---|
30 | }; |
---|
31 | // __________________________________________________________________________ |
---|
32 | class Table{ |
---|
33 | char* tomadato(const char* FieldName); |
---|
34 | public: |
---|
35 | bool eof,bof; |
---|
36 | MYSQL_RES * m_Rec ; |
---|
37 | MYSQL_FIELD *fields; |
---|
38 | unsigned int num_fields; |
---|
39 | MYSQL_ROW row ; |
---|
40 | MYSQL_ROW_OFFSET ptr; |
---|
41 | my_ulonglong numreg; |
---|
42 | char m_ErrStr[500]; |
---|
43 | Table(); |
---|
44 | void GetErrorErrStr(char* ErrStr); |
---|
45 | bool ISEOF(); |
---|
46 | bool MoveNext(); |
---|
47 | bool MovePrevious(); |
---|
48 | bool MoveFirst(); |
---|
49 | bool MoveLast(); |
---|
50 | |
---|
51 | bool Get(const char* FieldName, char* FieldValue); |
---|
52 | bool Get(const char* FieldName,int &FieldValue); |
---|
53 | bool Get(const char* FieldName,char &FieldValue); |
---|
54 | }; |
---|
55 | // __________________________________________________________________________ |
---|
56 | class Herror |
---|
57 | { |
---|
58 | public: |
---|
59 | int nError; // C�igo del error |
---|
60 | char dError[500]; // Descripción del error |
---|
61 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.