Fixing Build failure.
[csql.git] / include / SqlNwStatement.h
blob18132446ea2c4ba8254f7c55d050dc3c76004a51
1 /***************************************************************************
2 * Copyright (C) 2007 by Prabakaran Thirumalai *
3 * praba_tuty@yahoo.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 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #ifndef SQLNWSTATEMENT_H
21 #define SQLNWSTATEMENT_H
22 #include <AbsSqlStatement.h>
23 #include <SqlNwConnection.h>
24 #include <SqlFactory.h>
25 #include <CSql.h>
26 class SqlNwStatement: public AbsSqlStatement
28 public:
29 SqlNwStatement(){innerStmt = NULL; con = NULL; isPrepared=false; isSel = true; }
30 void setConnection(AbsSqlConnection *conn)
32 if (innerStmt) innerStmt->setConnection(conn->getInnerConnection());
33 con = conn;
35 ~SqlNwStatement() { if (isPrepared) free(); }
36 DbRetVal prepare(char *stmt);
38 DbRetVal execute(int &rowsAffect);
39 DbRetVal bindParam(int pos, void*);
41 DbRetVal bindField(int pos, void* val);
43 void* fetch();
44 void* fetch(DbRetVal &rv);
45 void* fetchAndPrint(bool SQL);
46 void* next();
47 DbRetVal close();
48 int noOfProjFields();
50 void* getFieldValuePtr( int pos );
52 DbRetVal free();
54 int noOfParamFields();
56 DbRetVal getProjFldInfo(int projPos, FieldInfo *&info);
58 DbRetVal getParamFldInfo(int paramPos, FieldInfo *&info);
60 void setShortParam(int paramPos, short value);
61 void setIntParam(int paramPos, int value);
62 void setLongParam(int paramPos, long value);
63 void setLongLongParam(int paramPos, long long value);
64 void setByteIntParam(int paramPos, ByteInt value);
65 void setFloatParam(int paramPos, float value);
66 void setDoubleParam(int paramPos, double value);
67 void setStringParam(int paramPos, char *value);
68 void setDateParam(int paramPos, Date value);
69 void setTimeParam(int paramPos, Time value);
70 void setTimeStampParam(int paramPos, TimeStamp value);
71 void setBinaryParam(int paramPos, void *value);
72 bool isSelect(){return isSel;}
73 void getPrimaryKeyFieldName(char *tablename, char *pkfieldname);
74 int getStmtID() { return stmtID; }
75 bool isFldNull(int pos){}
76 void setNull(int pos){}
77 void setStmtID(int id) { stmtID = id; }
78 int getFldPos(char *name){}
79 List getAllTableNames(DbRetVal &ret);
80 private:
81 bool isPrepared;
82 bool isSel;
83 int stmtID;
84 List paramList;
85 int noOfParams;
86 List bindList;
87 List tblNameList;
88 int noOfProjs;
89 friend class SqlFactory;
92 #endif