[go: up one dir, main page]

Menu

[r13]: / client / sqlclient.h  Maximize  Restore  History

Download this file

54 lines (38 with data), 776 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __SQL_CLIENT_H__
#define __SQL_CLIENT_H_
#include <gmp.h>
#include <index.h>
#include <data.h>
#include <sql.h>
#include <udt.h>
#include <client.h>
class SQLClient: public Client
{
friend class Query;
public:
Query* createQueryHandle();
void releaseQueryHandle(Query* q);
int getSemantics(const string& name, vector<DataAttr>& attr);
};
class Query
{
friend class SQLClient;
public:
Query();
~Query();
public:
int open(const string& query);
int close();
int fetch(char* res, int& rows, int& size);
private:
SQLClient* m_pSQLClient;
string m_strServerIP;
int m_iServerPort;
CGMP m_GMP;
string m_strQuery;
SQLExpr m_SQLExpr;
int m_iProtocol; // 1 UDT 2 TCP
UDTSOCKET m_uSock;
int m_tSock;
};
#endif