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