1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
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. *
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. *
15 ***************************************************************************/
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
];
33 strcpy(conditionVal
,"");
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);
49 DbRetVal
unload(bool tabDefinition
= true);
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
);
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
;}