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_ORACLE_COMMANDCOMMON_HH
00025 #define RESOURCEPOOL_ORACLE_COMMANDCOMMON_HH
00026
00027 #ifndef RESOURCEPOOL_ORACLE_COMMANDINTERFACE_HH
00028 #include "CommandInterface.hh"
00029 #endif
00030
00031 #ifndef RESOURCEPOOL_ORACLE_ORACLETYPEFWD_HH
00032 #include "oracleTypeFwd.hh"
00033 #endif
00034
00035 #ifndef INCLUDED_GC_PTR_HH
00036 #include "mm/gc_ptr.hh"
00037 #endif
00038
00039 #ifndef RESOURCEPOOL_COMMAND_HH
00040 #include "ResourcePool/Command.hh"
00041 #endif
00042
00043 #ifndef RESOURCEPOOL_ORACLE_OCIHANDLEFWD_HH
00044 #include "OCIHandleFwd.hh"
00045 #endif
00046
00047 #ifndef RESOURCEPOOL_SQL_BIND_HH
00048 #include "ResourcePool/SQL/Bind.hh"
00049 #endif
00050
00051 #ifndef RESOURCEPOOL_ORACLE_STATEMENTCACHE_HH
00052 #include "StatementCache.hh"
00053 #endif
00054
00055 #ifndef RESOURCEPOOL_ORACLE_ORACLESTATEMENT_HH
00056 #include "oracleStatement.hh"
00057 #endif
00058
00059 #include <string>
00060
00061 namespace fatalmind {
00062 namespace oracle {
00066 template<class TM, template<class> class SLMDC>
00067 class CommandCommon
00068 : public CommandInterface<TM, SLMDC>
00069 , public SQL::Bind<oracleType, oracleTypeImpl>
00070 {
00071 public:
00072 virtual ~CommandCommon();
00073
00074 virtual void outputoperator(std::ostream& s) const;
00075 protected:
00076 typedef SQL::Bind<oracleType, oracleTypeImpl> super_bind;
00081 CommandCommon(const std::string&);
00082
00083
00084
00085
00086
00087 virtual void _execute(oracleResource<TM>&, StatementCache&) = 0;
00088
00089
00090
00091
00092 void prepare(oracleHandles&, StatementCache&, const oracleStatement& oraSQL);
00093
00094
00095
00096
00097 void real_bind(oracleHandles&);
00098
00099 const std::string& getSQL() const;
00100
00101 virtual const std::string& getCommandName() const;
00102 static const std::string _CommandCommonName;
00103
00109 std::string _SQL;
00110
00114 StatementCache::handle_t _sth;
00115 };
00116
00117 }
00118 }
00119 #endif