00001 /* 00002 * $Id:ResultSet.h 540 2007-08-20 07:51:56Z mindstorm2600 $ 00003 * 00004 * X-VR2 00005 * 00006 * Copyright (C) Juan V. Guerrero 2007 00007 * 00008 * Juan V. Guerrero <mindstorm2600@users.sourceforge.net> 00009 * 00010 * This program is free software, distributed under the terms of 00011 * the GNU General Public License Version 2. See the LICENSE file 00012 * at the top of the source tree. 00013 */ 00014 #ifndef __XVR2_RESULTSET_H__ 00015 #define __XVR2_RESULTSET_H__ 00016 #include<xvr2/xvr2config.h> 00017 #include<xvr2/SQL/Driver.h> 00018 #include<xvr2/SQL/Field.h> 00019 #include<xvr2/SQL/DatabaseException.h> 00020 00021 namespace xvr2{ 00022 00023 namespace SQL { 00024 00025 class Driver; 00046 class ResultSet:public Object{ 00047 private: 00048 protected: 00049 bool _status; 00051 void *r_handle; 00053 Driver *driver; 00055 Field *row; 00056 int ncols; 00057 UInt64 afrows; 00058 bool is_a_select; 00059 int ridx; 00060 public: 00061 /* Constructor, please do not call it directly */ 00062 ResultSet(Driver *drv, void *__rhandle, bool __status); 00063 /* Constructor, please do not call it directly */ 00064 ResultSet(Driver *drv, void *__rhandle, bool __status, UInt64 afrows); 00065 ~ResultSet(); 00067 bool status(); 00069 const int numRows(); 00071 const int numCols(); 00073 const String &getColName(const int index); 00076 const Field *getRow(); 00079 const Field &get(const int index); 00082 const Field &get(const char *colname); 00085 const Field &get(const String &colname); 00094 const Field *fetchRow(); 00101 const Field *fetchNextRow(); 00106 const UInt64 affectedRows(); 00109 const char *errorMessage(); 00110 }; 00111 00112 }; 00113 }; 00114 00115 #endif