Logo Search packages:      
Sourcecode: poco version File versions  Download package

Public Types | Public Member Functions | Private Member Functions | Private Attributes

Poco::Data::ODBC::Preparation Class Reference

#include <Preparation.h>

Inheritance diagram for Poco::Data::ODBC::Preparation:
Inheritance graph
Collaboration diagram for Poco::Data::ODBC::Preparation:
Collaboration graph

List of all members.

Public Types

enum  DataExtraction { DE_MANUAL, DE_BOUND }

Public Member Functions

std::size_t actualDataSize (std::size_t pos) const
std::size_t columns () const
 Prepares an Any.
void duplicate () const
DataExtraction getDataExtraction () const
 Set data extraction mode.
std::size_t getMaxFieldSize () const
 Sets maximum supported field size.
std::size_t maxDataSize (std::size_t pos) const
Poco::Anyoperator[] (std::size_t pos)
 Returns the number of columns.
 Preparation (const StatementHandle &rStmt, const std::string &statement, std::size_t maxFieldSize, DataExtraction dataExtraction=DE_BOUND)
void prepare (std::size_t pos, const Poco::Data::BLOB &)
 Prepares a string.
void prepare (std::size_t pos, const Poco::Any &)
 Prepares a BLOB.
void prepare (std::size_t pos, Poco::UInt8)
 Prepares an Int8.
void prepare (std::size_t pos, Poco::Int64)
 Prepares an UInt32.
void prepare (std::size_t pos, Poco::UInt32)
 Prepares an Int32.
void prepare (std::size_t pos, Poco::Int16)
 Prepares an UInt8.
void prepare (std::size_t pos, const std::string &)
 Prepares a single character.
void prepare (std::size_t pos, char)
 Prepares a double.
void prepare (std::size_t pos, Poco::Int8)
 Destroys the Preparation.
void prepare (std::size_t pos, float)
 Prepares a boolean.
void prepare (std::size_t pos, Poco::UInt64)
 Prepares an Int64.
void prepare (std::size_t pos, bool)
 Prepares an UInt64.
void prepare (std::size_t pos, double)
 Prepares a float.
void prepare (std::size_t pos, Poco::UInt16)
 Prepares an Int16.
void prepare (std::size_t pos, Poco::Int32)
 Prepares an UInt16.
int referenceCount () const
void release () const
 Increments the object's reference count.
void setDataExtraction (DataExtraction ext)
void setMaxFieldSize (std::size_t size)
 Returns reference to column data.
 ~Preparation ()
 Creates the Preparation.

Private Member Functions

template<typename T >
void preparePOD (std::size_t pos, SQLSMALLINT valueType)
 Returns data extraction mode.
void prepareRaw (std::size_t pos, SQLSMALLINT valueType, std::size_t size)

Private Attributes

std::vector< char * > _charPtrs
DataExtraction _dataExtraction
std::size_t _maxFieldSize
std::vector< SQLLEN * > _pLengths
std::vector< Poco::Any * > _pValues
const StatementHandle_rStmt

Detailed Description

Class used for database preparation where we first have to register all data types with respective memory output locations before extracting data. Extraction works in two-phases: first prepare is called once, then extract n-times. In ODBC, SQLBindCol/SQLFetch is the preferred method of data retrieval (SQLGetData is available, however with numerous driver implementation dependent limitations). In order to fit this functionality into Poco DataConnectors framework, every ODBC SQL statement instantiates its own Preparation object. This is done once per statement execution (from StatementImpl::bindImpl()).

Preparation object is used to :

1) Prepare SQL statement. 2) Provide and contain the memory locations where retrieved values are placed during recordset iteration. 3) Keep count of returned number of columns with their respective datatypes and sizes.


Definition at line 66 of file Preparation.h.

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

Generated by  Doxygen 1.6.0   Back to index