*** empty log message ***
[csql.git] / include / CacheTableLoader.h
blob62af2deb6c92a070e370fa6b504fa4a00e825254
1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 ***************************************************************************/
16 #include <CSql.h>
17 #include <sql.h>
18 #include <sqlext.h>
19 #include <Network.h>
21 class CacheTableLoader
23 char tableName[IDENTIFIER_LENGTH];
24 char fieldName[IDENTIFIER_LENGTH];
25 char userName[IDENTIFIER_LENGTH];
26 char password[IDENTIFIER_LENGTH];
27 char conditionVal[IDENTIFIER_LENGTH]; //added newly
28 char fieldlistVal[IDENTIFIER_LENGTH];
29 public:
30 CacheTableLoader()
32 strcpy(tableName,"");
33 strcpy(conditionVal,"");
34 strcpy(fieldName,"");
35 strcpy(fieldlistVal,"");
37 void setConnParam(char *user, char *pass){ strcpy(userName, user); strcpy(password, pass); }
38 void setTable(char *tablename) { strcpy(tableName,tablename); }
39 void setCondition(char *condition){strcpy(conditionVal,condition);} //new one
40 void setFieldName(char *fldname){ strcpy(fieldName,fldname);}
41 DbRetVal addToCacheTableFile(bool isDirect);
42 static int getTableMode(char *tabname);
43 void setFieldListVal(char *field) {strcpy(fieldlistVal,field);}
45 DbRetVal addToCacheTableFile();
46 DbRetVal removeFromCacheTableFile();
47 DbRetVal load(bool tabDef=true);
48 DbRetVal reload();
49 DbRetVal unload(bool tabDefinition = true);
50 DbRetVal refresh();
51 DbRetVal recoverAllCachedTables();
52 DbRetVal load(DatabaseManager *dbMgr, bool tabDef);
53 DbRetVal isTableCached();
54 DbRetVal isTablePresent();// new one by :Jitendra
55 bool isFieldExist(char *fieldname);
58 class BindBuffer
60 public:
61 void *csql;
62 void *targetdb;
63 DataType type;
65 class CacheTableInfo
67 public:
68 char tableName[IDENTIFIER_LENGTH];
69 char fieldName[IDENTIFIER_LENGTH];
70 char projFieldlist[IDENTIFIER_LENGTH];
71 char condition[IDENTIFIER_LENGTH];
73 void setTableName(char *tblName){strcpy(tableName,tblName);}
74 void setFieldName(char *fldName){strcpy(fieldName,fldName);}
75 void setProjFieldList(char *fieldlist){ strcpy(projFieldlist,fieldlist);}
76 void setCondition(char *cond){ strcpy(condition,cond);}
77 char *getTableName(){return tableName;}
78 char *getFieldName(){return fieldName;}
79 char *getCondition(){ return condition;}
80 char *getProjFieldList(){return projFieldlist;}