00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SQLLOGSTATEMENT_H
00021 #define SQLLOGSTATEMENT_H
00022 #include <AbsSqlStatement.h>
00023 #include <SqlLogConnection.h>
00024 #include <SqlFactory.h>
00025 #include <CSql.h>
00026 class SqlLogStatement: public AbsSqlStatement
00027 {
00028 public:
00029 SqlLogStatement(){innerStmt = NULL; con = NULL; needLog= false; sid=0; }
00030
00031 void setConnection(AbsSqlConnection *conn)
00032 {
00033 if (innerStmt) innerStmt->setConnection(conn->getInnerConnection());
00034 con = conn;
00035 }
00036
00037 bool isNonSelectDML(char *stmtstr);
00038 DbRetVal prepare(char *stmt);
00039
00040 DbRetVal execute(int &rowsAffect);
00041 DbRetVal bindParam(int pos, void*);
00042
00043 DbRetVal bindField(int pos, void* val);
00044
00045 void* fetch();
00046 void* fetchAndPrint(bool SQL);
00047 void* next();
00048 DbRetVal close();
00049 int noOfProjFields();
00050
00051 void* getFieldValuePtr( int pos );
00052
00053 DbRetVal free();
00054
00055 int noOfParamFields();
00056
00057 DbRetVal getProjFldInfo(int projPos, FieldInfo *&info);
00058
00059 DbRetVal getParamFldInfo(int paramPos, FieldInfo *&info);
00060
00061 void setShortParam(int paramPos, short value);
00062 void setIntParam(int paramPos, int value);
00063 void setLongParam(int paramPos, long value);
00064 void setLongLongParam(int paramPos, long long value);
00065 void setByteIntParam(int paramPos, ByteInt value);
00066 void setFloatParam(int paramPos, float value);
00067 void setDoubleParam(int paramPos, double value);
00068 void setStringParam(int paramPos, char *value);
00069 void setDateParam(int paramPos, Date value);
00070 void setTimeParam(int paramPos, Time value);
00071 void setTimeStampParam(int paramPos, TimeStamp value);
00072 bool isSelect();
00073
00074 bool isCached;
00075 TableSyncMode mode;
00076 private:
00077
00078 bool needLog;
00079 int sid;
00080 List paramList;
00081
00082 static UniqueID stmtUID;
00083 friend class SqlFactory;
00084 };
00085
00086 #endif