00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef RESOURCEPOOL_SQL_RTSQLEXECUTE_HH
00025 #define RESOURCEPOOL_SQL_RTSQLEXECUTE_HH
00026
00027 #include "mm/gc_ptr.hh"
00028 #include "ResourcePool/SQL/RTSQLCommand.hh"
00029 #include "ResourcePool/SQL/Resource.hh"
00030 #include "ResourcePool/SQL/RTCommandParameters.hh"
00031 #include "ResourcePool/SQL/BindInterface.hh"
00032 #include "ResourcePool/ResourcePool.hh"
00033
00034 namespace fatalmind {
00035 namespace SQL {
00036
00037 template<class TM> class RTSQLExecute_Impl;
00038 template<class TM> class RTSQLBatch;
00039
00046 template<class TM>
00047 class RTSQLExecute
00048 : public RTSQLCommand<TM>
00049 , public BindInterface
00050 {
00051 public:
00056 RTSQLExecute(const ResourcePool<ResourceType<TM> >& p, const std::string& sql);
00057 RTSQLExecute(const RTSQLExecute<TM>& rho);
00058 virtual ~RTSQLExecute();
00059
00060 template<typename T>
00061 void bind(const unsigned int pos, const T& val, bool nul = false);
00062
00063 virtual void clearParameters();
00064
00065 void execute(typename ResourceType<TM>::resource_t& hand);
00066 virtual void outputoperator(std::ostream&) const;
00067
00068 virtual const Clone* getPlainSpecializedCommand() const;
00069 protected:
00070 virtual Clone* DoClone() const;
00071
00072 private:
00073 typedef RTSQLExecute_Impl<TM> rimpl_t;
00074 gc_ptr<rimpl_t> _realSQLExecute;
00075
00076 typedef typename SQLFactory<TM>::databaseType_t databaseType_t;
00077 RTSQLExecute();
00078 };
00079
00080
00081 }
00082 }
00083 #endif