source: admin/Sources/Includes/Database.h @ a2a6484

918-git-images-111dconfigfileconfigure-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-instalacionwebconsole3
Last change on this file since a2a6484 was 21bfeb0, checked in by irina <irinagomez@…>, 8 years ago

#559 ogAdmServer: Se libera memoria de variables y de resultados de la base de datos. Database.cpp y Database.h: Se crea función liberaResult.

git-svn-id: https://opengnsys.es/svn/branches/version1.1@5132 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100644
File size: 1.9 KB
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// __________________________________________________________________________
14class Database;
15class Table;
16// __________________________________________________________________________
17class Database
18{
19public:
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// __________________________________________________________________________
32class Table{
33        char* tomadato(const char* FieldName);
34public:
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// __________________________________________________________________________
56class Herror
57{
58public:
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.