fatalmind::oracle::SQLExecute< TM, SLMDC > Class Template Reference

#include <SQLExecute.hh>

Inherits fatalmind::oracle::CommandCommon< TM, SLMDC >< TM, SLMDC >.

List of all members.


Detailed Description

template<class TM, template< class >class SLMDC>
class fatalmind::oracle::SQLExecute< TM, SLMDC >

A Command to issue an non-select SQL statement (update, insert, delete) against an oracle database.

Public Types

typedef
fatalmind::oracle::ResourceType
< TM, SLMDC > 
pool_type
typedef VBC _datat
typedef gc_ptr< VBC > _ptrt
typedef std::vector
< _ptrt
_argst

Public Member Functions

 SQLExecute (const SQL::SQLStatement &SQL)
 SQLExecute (const ResourcePool< ResourceType< TM > > &p, const SQL::SQLStatement &SQL)
bool addBatch (const SQLExecute< TM, SLMDC > &p)
std::auto_ptr
< Command
< oracle::ResourceType
< TM, SLMDC > > > 
addBatch2 (const SQLExecute< TM, SLMDC > &p)
int batchSize () const
virtual void outputoperator (std::ostream &s) const
virtual void execute (oracleResource< TM > &hand)
virtual void execute (typename fatalmind::oracle::ResourceType< TM, SLMDC >::resource_t &rr)=0
 The execute method is the one which actually carries out the work.
virtual void bind (const unsigned int pos, const char &val, bool isnull=false)
 Binds an actual input value for an placeholder in the SQL statement.
virtual void bind (const unsigned int pos, const signed char &val, bool isnull=false)
virtual void bind (const unsigned int pos, const unsigned char &val, bool isnull=false)
virtual void bind (const unsigned int pos, const short int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const unsigned short int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const unsigned int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const long int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const unsigned long int &val, bool isnull=false)
virtual void bind (const unsigned int pos, const float &val, bool isnull=false)
virtual void bind (const unsigned int pos, const double &val, bool isnull=false)
virtual void bind (const unsigned int pos, const long double &val, bool isnull=false)
virtual void bind (const unsigned int pos, const std::string &val, bool isnull=false)
virtual void clearParameters ()

Static Public Member Functions

static void bindoutputoperator (std::ostream &str, const _argst &)

Protected Types

typedef SQL::Bind
< oracleType,
oracleTypeImpl > 
super_bind

Protected Member Functions

 SQLExecute (const this_t &)
virtual Clone * DoClone () const
void _execute (fatalmind::oracleResource< TM > &, StatementCache &)
bool push_onto_BatchParamSizes (const typename super::super_bind::_argst &p)
void copySizeIndicator (const typename super::super_bind::_argst &p)
virtual const
std::string & 
getCommandName () const
void handleBatchException (int ret, oracleResource< TM > &rhand)
void throwBatchException () const
int getBatchExceptionOffset () const
void real_bind_batch (oracleResource< TM > &)
virtual void bindoutputoperator (std::ostream &str) const
StatementCache::handle_t prepare (oracleResource< TM > &, StatementCache &, const oracleStatement &oraSQL)
void real_bind (oracleResource< TM > &, OCIStatementHandle &sth)
const std::string & getSQL () const
const
fatalmind::oracle::ResourceType
< TM, SLMDC >
::factory_t & 
getFactory (const ResourcePool< fatalmind::oracle::ResourceType< TM, SLMDC > > &p) const
bool topLevel () const
void topLevel (bool tl)

Protected Attributes

oracleStatement _SQL
 this is a copy of the original SQL statement.
_argst _args

Static Protected Attributes

static const std::string _SQLExecuteName
static const std::string _CommandCommonName

Friends

class oracle::OptimizedBatchCommand< Command< oracle::ResourceType< TM, SLMDC > > >
class Transaction< TM, SLMDC >
class ResourcePool< PT >

Member Function Documentation

virtual void fatalmind::Command< fatalmind::oracle::ResourceType< TM, SLMDC > >::execute ( typename fatalmind::oracle::ResourceType< TM, SLMDC > ::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.

template<class VBC, template< class > class CT>
virtual void fatalmind::SQL::Bind< VBC, CT >::bind ( const unsigned int  pos,
const char &  val,
bool  isnull = false 
) [inline, virtual, inherited]

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. Changing 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!

Implements fatalmind::SQL::BindInterface.


The documentation for this class was generated from the following files:
Generated on Mon Nov 9 16:21:24 2009 for ResourcePool by  doxygen 1.5.3