sptk2 logo
SPTK Home Page
Public Member Functions | Protected Member Functions | List of all members
sptk::QueryStatementManagement Class Reference
Inheritance diagram for sptk::QueryStatementManagement:
sptk::DataSource sptk::Query sptk::InsertQuery

Public Member Functions

 QueryStatementManagement (bool autoPrepare)
 
 QueryStatementManagement (const QueryStatementManagement &other)=delete
 
StmtHandle statement () const
 
bool autoPrepare () const
 
bool active () const
 
bool prepared () const
 
bool eof () const override
 
bool bulkMode () const
 
void connect (PoolDatabaseConnection *db)
 
void disconnect ()
 
PoolDatabaseConnectiondatabase () const
 
void database (PoolDatabaseConnection *db)
 
- Public Member Functions inherited from sptk::DataSource
 DataSource ()=default
 
virtual ~DataSource ()=default
 
virtual Fieldoperator[] (size_t fieldIndex)=0
 
virtual Fieldoperator[] (const String &fieldName)=0
 
virtual size_t fieldCount () const =0
 
virtual size_t recordCount () const =0
 
virtual bool readField (const char *fieldName, Variant &fieldValue)=0
 
virtual bool writeField (const char *fieldName, const Variant &fieldValue)=0
 
virtual bool open ()
 
virtual bool close ()
 
virtual bool first ()
 
virtual bool next ()
 
virtual bool prior ()
 
virtual bool last ()
 
virtual bool find (const String &, const Variant &)
 
virtual bool eof () const
 
bool load ()
 
bool save ()
 
void exportRowTo (const xdoc::SNode &node, bool compactXmlMode, bool nullLargeData=false)
 
virtual void exportTo (xdoc::Node &parentNode, const String &nodeName, bool compactXmlMode)
 

Protected Member Functions

void setDatabase (PoolDatabaseConnection *db)
 
void setStatement (StmtHandle statement)
 
void setPrepared (bool prepared)
 
void setActive (bool active)
 
void setEof (bool eof)
 
void setBulkMode (bool _bulkMode)
 
void closeStmt (bool freeStatement=false)
 
void closeQuery (bool releaseStatement=false)
 
Stringsmessages ()
 
StringgetSQL ()
 
const StringgetSQL () const
 
void setSQL (const String &sql)
 
void notImplemented (const String &functionName) const
 
- Protected Member Functions inherited from sptk::DataSource
virtual bool loadData ()
 
virtual bool saveData ()
 

Constructor & Destructor Documentation

◆ QueryStatementManagement()

sptk::QueryStatementManagement::QueryStatementManagement ( bool  autoPrepare)
inlineexplicit

Constructor

Parameters
autoPrepareIf true the auto-prepare statement

Member Function Documentation

◆ active()

bool sptk::QueryStatementManagement::active ( ) const
inline

Reports if the query is opened

◆ autoPrepare()

bool sptk::QueryStatementManagement::autoPrepare ( ) const
inline

Returns the value for auto-prepare flag.

If the flag is set the query would automatically call prepare() when needed.

◆ bulkMode()

bool sptk::QueryStatementManagement::bulkMode ( ) const

Return bulk mode flag

Returns
true for bulk mode

◆ closeQuery()

void sptk::QueryStatementManagement::closeQuery ( bool  releaseStatement = false)
protected

Closes query by closing the statement.

If the statement isn't released it may be re-used later.

Parameters
releaseStatementTrue if we need to release the query's ODBC statement

◆ closeStmt()

void sptk::QueryStatementManagement::closeStmt ( bool  freeStatement = false)
protected

Closes a statement. Prepared statement stay prepared but closed.

Parameters
freeStatementIf true then statement is freed.

◆ connect()

void sptk::QueryStatementManagement::connect ( PoolDatabaseConnection db)

Connects a query to a database

If the query was connected to another database, releases all the allocated resources in it.

◆ database() [1/2]

PoolDatabaseConnection * sptk::QueryStatementManagement::database ( ) const
inline

Returns the database the query is connected to

◆ database() [2/2]

void sptk::QueryStatementManagement::database ( PoolDatabaseConnection db)
inline

Connects the query to the database different database.

◆ disconnect()

void sptk::QueryStatementManagement::disconnect ( )

Disconnects query from the database and releases all the allocated resourses.

◆ eof()

bool sptk::QueryStatementManagement::eof ( ) const
inlineoverridevirtual

Returns true if there is no more rows in the recordset

Reimplemented from sptk::DataSource.

◆ messages()

Strings & sptk::QueryStatementManagement::messages ( )
inlineprotected

Optional diagnostic messages populated after exec() or open()

◆ notImplemented()

void sptk::QueryStatementManagement::notImplemented ( const String functionName) const
protected

Internal function to throw 'Not implemented' exception

◆ prepared()

bool sptk::QueryStatementManagement::prepared ( ) const
inline

True if the statement is prepared

◆ setBulkMode()

void sptk::QueryStatementManagement::setBulkMode ( bool  _bulkMode)
protected

Set bulk mode flag

Parameters
_bulkModeTrue for bulk mode

◆ setDatabase()

void sptk::QueryStatementManagement::setDatabase ( PoolDatabaseConnection db)
protected

Set database (internal)

◆ setStatement()

void sptk::QueryStatementManagement::setStatement ( StmtHandle  statement)
inlineprotected

Returns query statement handle

◆ statement()

StmtHandle sptk::QueryStatementManagement::statement ( ) const
inline

Returns query statement handle


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

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