SQLQuery.h++
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __ccxx_SQLQuery_hxx
00024 #define __ccxx_SQLQuery_hxx
00025
00026 #include <commonc++/Common.h++>
00027 #include <commonc++/Blob.h++>
00028 #include <commonc++/InterruptedException.h++>
00029 #include <commonc++/SQLException.h++>
00030 #include <commonc++/String.h++>
00031 #include <commonc++/Variant.h++>
00032
00033 namespace ccxx {
00034
00035 class SQLDatabase;
00036 class SQLPrivate;
00037
00057 class COMMONCPPDB_API SQLQuery
00058 {
00059 friend class SQLDatabase;
00060
00061 public:
00062
00064 ~SQLQuery() throw();
00065
00070 void reset() throw(SQLException);
00071
00077 String toSQL() throw(SQLException);
00078
00085 void bind(uint_t index) throw(SQLException);
00086
00092 void bind(const String &name) throw(SQLException);
00093
00101 void bind(uint_t index, int value) throw(SQLException);
00102
00109 void bind(const String &name, int value) throw(SQLException);
00110
00119 void bind(uint_t index, const int64_t &value) throw(SQLException);
00120
00128 void bind(const String &name, const int64_t &value) throw(SQLException);
00129
00138 void bind(uint_t index, const double &value) throw(SQLException);
00139
00147 void bind(const String &name, const double &value) throw(SQLException);
00148
00156 void bind(uint_t index, const String &value) throw(SQLException);
00157
00164 void bind(const String &name, const String &value) throw(SQLException);
00165
00173 void bind(uint_t index, const char *value) throw(SQLException);
00174
00181 void bind(const String &name, const char *value) throw(SQLException);
00182
00191 void bind(uint_t index, const Blob &value) throw(SQLException);
00192
00199 void bind(const String &name, const Blob &value) throw(SQLException);
00200
00205 void clear() throw(SQLException);
00206
00211 uint_t getParameterCount() throw(SQLException);
00212
00219 void execute() throw(SQLException, InterruptedException);
00220
00231 bool next() throw(SQLException, InterruptedException, TimeoutException);
00232
00238 uint_t getColumnCount() throw(SQLException);
00239
00247 Variant getColumnValue(uint_t column) throw(SQLException);
00248
00255 String getColumnName(uint_t column) throw(SQLException);
00256
00263 String getAliasedColumnName(uint_t column) throw(SQLException);
00264
00271 String getTableName(uint_t column) throw(SQLException);
00272
00280 int getInt(uint_t column) throw(SQLException);
00281
00289 int64_t getInt64(uint_t column) throw(SQLException);
00290
00298 double getDouble(uint_t column) throw(SQLException);
00299
00307 String getString(uint_t column) throw(SQLException);
00308
00316 Blob getBlob(uint_t column) throw(SQLException);
00317
00318 private:
00319
00320 SQLQuery(const SQLPrivate &private_);
00321
00322 void prime() throw(SQLException, InterruptedException);
00323 void _next() throw();
00324
00325 String _getString(uint_t column) throw();
00326 Blob _getBlob(uint_t column) throw();
00327
00328 SQLPrivate *_private;
00329 int _result;
00330 bool _primed;
00331 bool _hasData;
00332
00333 CCXX_COPY_DECLS(SQLQuery);
00334 };
00335
00336 }
00337
00338 #endif // __ccxx_SQLQuery_hxx