00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef ABSSQLSTATEMENT_H
00021 #define ABSSQLSTATEMENT_H
00022
00023
00024
00025 #include<AbsSqlConnection.h>
00026
00027 class Statement;
00028 class ParsedData;
00029
00043 class AbsSqlStatement
00044 {
00045 protected:
00046 AbsSqlStatement(){}
00047 AbsSqlStatement *innerStmt;
00048 AbsSqlConnection *con;
00049 public:
00050 void setInnerStatement(AbsSqlStatement *stmt) { innerStmt = stmt; }
00054 virtual void setConnection(AbsSqlConnection *conn) { con = conn; }
00055
00063 virtual DbRetVal prepare(char *stmt) = 0;
00064
00069 virtual char* getTableName(){ return NULL; }
00070
00078 virtual DbRetVal execute(int &rowsAffect) =0;
00079
00085 virtual void* fetch() = 0;
00086
00087
00093 virtual void* fetchAndPrint(bool SQL) = 0;
00094
00095
00106 virtual DbRetVal bindParam(int pos, void*) = 0;
00107
00120 virtual DbRetVal bindField(int pos, void* val) = 0;
00121
00125 virtual void* next() = 0;
00126
00130 virtual DbRetVal close() = 0;
00131
00135 virtual void* getFieldValuePtr( int pos ) = 0;
00136
00140 virtual DbRetVal free() = 0;
00141
00145 virtual int noOfProjFields() = 0;
00146
00150 virtual int noOfParamFields() = 0;
00151
00157 virtual DbRetVal getProjFldInfo(int projPos, FieldInfo *&info) = 0;
00158
00164 virtual DbRetVal getParamFldInfo(int paramPos, FieldInfo *&info) = 0;
00165
00170 virtual void setShortParam(int paramPos, short value) = 0;
00175 virtual void setIntParam(int paramPos, int value) = 0;
00180 virtual void setLongParam(int paramPos, long value) =0;
00185 virtual void setLongLongParam(int paramPos, long long value) =0;
00190 virtual void setByteIntParam(int paramPos, ByteInt value) = 0;
00195 virtual void setFloatParam(int paramPos, float value) = 0;
00200 virtual void setDoubleParam(int paramPos, double value) = 0;
00205 virtual void setStringParam(int paramPos, char *value) = 0;
00210 virtual void setDateParam(int paramPos, Date value) = 0;
00215 virtual void setTimeParam(int paramPos, Time value) = 0;
00220 virtual void setTimeStampParam(int paramPos, TimeStamp value) = 0;
00221
00225 virtual bool isSelect() = 0;
00226
00227 virtual ~AbsSqlStatement(){}
00228 };
00229
00230
00231
00232 class BindSqlField
00233 {
00234 public:
00235 DataType type;
00236 int length;
00237 void *value;
00238 void *targetvalue;
00239 BindSqlField(){ value = NULL; targetvalue = NULL; }
00240 };
00241
00242 class BindSqlProjectField
00243 {
00244 public:
00245 char fName[IDENTIFIER_LENGTH];
00246 DataType type;
00247 int length;
00248 void *value;
00249 void *targetvalue;
00250 BindSqlProjectField(){ value = NULL; targetvalue = NULL; }
00251 };
00252
00253 #endif