sptk2 logo
SPTK Home Page
Classes | Public Member Functions | Protected Member Functions | List of all members
sptk::DatabaseStatement< Connection, Statement > Class Template Referenceabstract

#include <DatabaseStatement.h>

Classes

struct  State
 

Public Member Functions

Connection * connection () const
 
void statement (Statement *stmt)
 
Statement * statement () const
 
 DatabaseStatement (Connection *connection)
 
virtual ~DatabaseStatement ()=default
 
Statement * stmt () const
 
virtual void enumerateParams (QueryParameterList &queryParams)
 
CParamVectorenumeratedParams ()
 
size_t outputParameterCount () const
 
virtual void setParameterValues ()=0
 
virtual void execute (bool inTransaction)=0
 
virtual void close ()=0
 
virtual void fetch ()=0
 
bool eof () const
 
unsigned colCount () const
 

Protected Member Functions

Statestate ()
 

Detailed Description

template<class Connection, class Statement>
class sptk::DatabaseStatement< Connection, Statement >

Template class for database statements for different database drivers

Constructor & Destructor Documentation

◆ DatabaseStatement()

template<class Connection , class Statement >
sptk::DatabaseStatement< Connection, Statement >::DatabaseStatement ( Connection *  connection)
inlineexplicit

Constructor

Parameters
connectionConnection*, DB connection

◆ ~DatabaseStatement()

template<class Connection , class Statement >
virtual sptk::DatabaseStatement< Connection, Statement >::~DatabaseStatement ( )
virtualdefault

Destructor

Member Function Documentation

◆ close()

template<class Connection , class Statement >
virtual void sptk::DatabaseStatement< Connection, Statement >::close ( )
pure virtual

Closes statement and releases allocated resources

Implemented in sptk::MySQLStatement, and sptk::OracleStatement.

◆ colCount()

template<class Connection , class Statement >
unsigned sptk::DatabaseStatement< Connection, Statement >::colCount ( ) const
inline

Returns recordset number of columns

References sptk::DatabaseStatement< Connection, Statement >::State::columnCount.

◆ enumeratedParams()

template<class Connection , class Statement >
CParamVector & sptk::DatabaseStatement< Connection, Statement >::enumeratedParams ( )
inline

Returns normalized list of parameters

◆ enumerateParams()

template<class Connection , class Statement >
virtual void sptk::DatabaseStatement< Connection, Statement >::enumerateParams ( QueryParameterList queryParams)
inlinevirtual

Generates normalized list of parameters

Parameters
queryParamsCParamList&, Standard query parameters

Reimplemented in sptk::MySQLStatement.

References sptk::QueryParameterList::enumerate(), and sptk::DatabaseStatement< Connection, Statement >::State::outputParameterCount.

◆ eof()

template<class Connection , class Statement >
bool sptk::DatabaseStatement< Connection, Statement >::eof ( ) const
inline

Returns true if recordset is in EOF state

References sptk::DatabaseStatement< Connection, Statement >::State::eof.

◆ execute()

template<class Connection , class Statement >
virtual void sptk::DatabaseStatement< Connection, Statement >::execute ( bool  inTransaction)
pure virtual

Executes statement

Parameters
inTransactionbool, True if statement is executed from transaction

Implemented in sptk::OracleStatement, and sptk::MySQLStatement.

◆ fetch()

template<class Connection , class Statement >
virtual void sptk::DatabaseStatement< Connection, Statement >::fetch ( )
pure virtual

Fetches next record

Implemented in sptk::MySQLStatement, and sptk::OracleStatement.

◆ outputParameterCount()

template<class Connection , class Statement >
size_t sptk::DatabaseStatement< Connection, Statement >::outputParameterCount ( ) const
inline

Returns true if statement uses output parameters

References sptk::DatabaseStatement< Connection, Statement >::State::outputParameterCount.

◆ setParameterValues()

template<class Connection , class Statement >
virtual void sptk::DatabaseStatement< Connection, Statement >::setParameterValues ( )
pure virtual

Sets actual parameter values for the statement execution

Implemented in sptk::MySQLStatement, and sptk::OracleStatement.

◆ stmt()

template<class Connection , class Statement >
Statement * sptk::DatabaseStatement< Connection, Statement >::stmt ( ) const
inline

Returns current DB statement handle


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

Fri Oct 14 2022 09:58:41: SPTK 5.4.1