fatalmind::SQL::RTSQLExecute< TM > Class Template Reference

#include <RTSQLExecute.hh>

Inherits fatalmind::SQL::RTSQLCommand< TM >, and fatalmind::SQL::BindInterface.

List of all members.


Detailed Description

template<class TM>
class fatalmind::SQL::RTSQLExecute< TM >

A command to issue a non-select statement against an SQL database.

Automatically commits if not encapsulated into a Transaction Command.

Public Types

typedef PT pool_type

Public Member Functions

 RTSQLExecute (const ResourcePool< ResourceType< TM > > &p, const std::string &sql)
 Creates a new command to issue the specified SQL statement against the passed ResourcePool.
 RTSQLExecute (const RTSQLExecute< TM > &rho)
template<typename T>
void bind (const unsigned int pos, const T &val, bool nul=false)
 Binds an actual input value for an placeholder in the SQL statement.
virtual void clearParameters ()
void execute (typename ResourceType< TM >::resource_t &hand)
virtual void outputoperator (std::ostream &) const
virtual const Clone * getPlainSpecializedCommand () const
virtual void execute (typename PT::resource_t &rr)=0
 The execute method is the one which actually carries out the work.
Clone * clone () const
template<class Derived>
Derived * clone () const

Protected Member Functions

virtual Clone * DoClone () const
const PT::factory_t & getFactory (const ResourcePool< PT > &p) const


Member Function Documentation

template<class TM>
template<class T>
void fatalmind::SQL::RTSQLExecute< TM >::bind ( const unsigned int  pos,
const T &  val,
bool  nul = false 
) [inline]

Binds an actual input value for an placeholder in the SQL statement.

All binding is done by value! this means the passed data are copied to internal storage. Chaning your original copy of your data after passing it to bind() is therefore safe.

Parameters:
pos The position indicator. The number of placeholder (?) in the SQL string. Counted from the left starting at 0.
val the actual value.
nul NULL inidcator, if set to yes the actual value to be bound will be NULL. Please note that you still need to provide a valid value!

Reimplemented from fatalmind::SQL::BindInterface.

template<class PT>
virtual void fatalmind::Command< PT >::execute ( typename PT::resource_t &  rr  )  [pure virtual, inherited]

The execute method is the one which actually carries out the work.

This method gets called by ResourcePool with a (valid) plain resource which was obtained from the pool.

On normal execution (no exception) the resource will be free()ed, on abnormal execution (exception) the resource will be failed. If you need to throw an functional exception which should not cause failing of the resource, derive this exception from NoFailoverException.


The documentation for this class was generated from the following files:

Generated on Mon Jun 9 11:27:04 2008 for ResourcePool by  doxygen 1.5.5