NCBI C++ ToolKit
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends
CODBC_RowResult Class Reference

Search Toolkit Book for CODBC_RowResult

#include <dbapi/driver/odbc/interfaces.hpp>

+ Inheritance diagram for CODBC_RowResult:
+ Collaboration diagram for CODBC_RowResult:

List of all members.

Classes

struct  t_SODBC_ColDescr

Public Member Functions

CStatementBaseGetStatementBase (void)
const CStatementBaseGetStatementBase (void) const
EEncoding GetClientEncoding (void) const

Protected Member Functions

 CODBC_RowResult (CStatementBase &stmt, SQLSMALLINT nof_cols, SQLLEN *row_count)
virtual ~CODBC_RowResult (void)
virtual EDB_ResType ResultType (void) const
 Get type of the result.
virtual bool Fetch (void)
 Fetch next row.
virtual int CurrentItemNo (void) const
 Return current item number we can retrieve (0,1,...) Return "-1" if no more items left (or available) to read.
virtual int GetColumnNum (void) const
 Return number of columns in the recordset.
virtual CDB_ObjectGetItem (CDB_Object *item_buf=0, I_Result::EGetItem policy=I_Result::eAppendLOB)
 Get a result item (you can use either GetItem or ReadItem).
virtual size_t ReadItem (void *buffer, size_t buffer_size, bool *is_null=0)
 Read a result item body (for text/image mostly).
virtual I_ITDescriptorGetImageOrTextDescriptor (void)
 Get a descriptor for text/image column (for SendData).
CDB_ITDescriptorGetImageOrTextDescriptor (int item_no, const string &cond)
virtual bool SkipItem (void)
 Skip result item.
int xGetData (SQLSMALLINT target_type, SQLPOINTER buffer, SQLINTEGER buffer_size)
CDB_Objectx_LoadItem (I_Result::EGetItem policy, CDB_Object *item_buf)
CDB_Objectx_MakeItem (void)
SQLHSTMT GetHandle (void) const
void ReportErrors (void)
NCBI_NORETURN void ReportError (CDB_Exception &ex) const
const CODBC_Connection::TDbgInfoGetDbgInfo (void) const
const CDBParamsGetLastParams (void) const
const CODBC_ConnectionGetConnection (void) const
void Close (void)
bool CheckSIENoD_Text (CDB_Stream *val)
bool CheckSIENoD_Binary (CDB_Stream *val)

Private Types

enum  { eODBC_Column_Name_Size = 80 }
typedef struct
CODBC_RowResult::t_SODBC_ColDescr 
SODBC_ColDescr

Private Attributes

CStatementBasem_Stmt
int m_CurrItem
bool m_EOR
unsigned int m_CmdNum
SODBC_ColDescrm_ColFmt
SQLLEN *const m_RowCountPtr
string m_LastReadData
bool m_HasMoreData

Friends

class CODBC_LangCmd
class CODBC_RPCCmd
class CODBC_CursorCmd
class CODBC_Connection
class CODBC_CursorCmdExpl
class CODBC_SendDataCmd

Detailed Description

Definition at line 724 of file interfaces.hpp.


Member Typedef Documentation


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
eODBC_Column_Name_Size 

Definition at line 819 of file interfaces.hpp.


Constructor & Destructor Documentation

CODBC_RowResult::CODBC_RowResult ( CStatementBase stmt,
SQLSMALLINT  nof_cols,
SQLLEN row_count 
) [protected]
CODBC_RowResult::~CODBC_RowResult ( void  ) [protected, virtual]

Definition at line 1171 of file result.cpp.

References Close(), m_ColFmt, m_EOR, NCBI_CATCH_ALL_X, and NCBI_CURRENT_FUNCTION.


Member Function Documentation

void CODBC_RowResult::Close ( void  ) [inline, protected]

Definition at line 804 of file interfaces.hpp.

Referenced by ~CODBC_RowResult().

int CODBC_RowResult::CurrentItemNo ( void  ) const [protected, virtual]

Return current item number we can retrieve (0,1,...) Return "-1" if no more items left (or available) to read.

Implements impl::CResult.

Definition at line 205 of file result.cpp.

References m_CurrItem.

bool CODBC_RowResult::Fetch ( void  ) [protected, virtual]
EEncoding CODBC_RowResult::GetClientEncoding ( void  ) const [inline]
int CODBC_RowResult::GetColumnNum ( void  ) const [protected, virtual]

Return number of columns in the recordset.

Implements impl::CResult.

Definition at line 210 of file result.cpp.

References impl::CResult::GetDefineParams(), and CDBParams::GetNum().

const CODBC_Connection& CODBC_RowResult::GetConnection ( void  ) const [inline, protected]

Definition at line 800 of file interfaces.hpp.

const CODBC_Connection::TDbgInfo& CODBC_RowResult::GetDbgInfo ( void  ) const [inline, protected]
SQLHSTMT CODBC_RowResult::GetHandle ( void  ) const [inline, protected]
I_ITDescriptor * CODBC_RowResult::GetImageOrTextDescriptor ( void  ) [protected, virtual]

Get a descriptor for text/image column (for SendData).

Return NULL if this result doesn't (or can't) have img/text descriptor. NOTE: you need to call ReadItem (maybe even with buffer_size == 0) before calling this method!

Implements impl::CResult.

Definition at line 1155 of file result.cpp.

References m_CurrItem.

Referenced by CODBC_CursorCmd::x_GetITDescriptor(), and CODBC_CursorCmdExpl::x_GetITDescriptor().

CDB_Object * CODBC_RowResult::GetItem ( CDB_Object item_buf = 0,
I_Result::EGetItem  policy = I_Result::eAppendLOB 
) [protected, virtual]

Get a result item (you can use either GetItem or ReadItem).

If "item_buf" is not NULL, then use "*item_buf" (its type should be compatible with the type of retrieved item!) to retrieve the item to; otherwise allocate new "CDB_Object".

Implements impl::CResult.

Definition at line 963 of file result.cpp.

References impl::CResult::GetDefineParams(), m_CurrItem, x_LoadItem(), and x_MakeItem().

const CDBParams* CODBC_RowResult::GetLastParams ( void  ) const [inline, protected]

Definition at line 796 of file interfaces.hpp.

Definition at line 734 of file interfaces.hpp.

Definition at line 738 of file interfaces.hpp.

size_t CODBC_RowResult::ReadItem ( void *  buffer,
size_t  buffer_size,
bool is_null = 0 
) [protected, virtual]

Read a result item body (for text/image mostly).

Return number of successfully read bytes. Set "*is_null" to TRUE if the item is <NULL>. Throw an exception on any error.

Implements impl::CResult.

Definition at line 976 of file result.cpp.

References buffer_size, CWString::ConvertTo(), DATABASE_DRIVER_ERROR, CODBC_RowResult::t_SODBC_ColDescr::DataType, f(), GetClientEncoding(), GetDbgInfo(), impl::CResult::GetDefineParams(), GetHandle(), m_ColFmt, m_CurrItem, m_HasMoreData, m_LastReadData, ReportErrors(), SQL_C_BINARY, SQL_ERROR, SQL_NO_DATA, SQL_NO_TOTAL, SQL_NULL_DATA, SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_WCHAR, SQL_WLONGVARCHAR, SQL_WVARCHAR, SQLGetData(), and SQLLEN.

NCBI_NORETURN void CODBC_RowResult::ReportError ( CDB_Exception ex) const [inline, protected]

Definition at line 786 of file interfaces.hpp.

void CODBC_RowResult::ReportErrors ( void  ) [inline, protected]
EDB_ResType CODBC_RowResult::ResultType ( void  ) const [protected, virtual]

Get type of the result.

Implements impl::CResult.

Reimplemented in CODBC_ParamResult, and CODBC_StatusResult.

Definition at line 163 of file result.cpp.

References eDB_RowResult.

bool CODBC_RowResult::SkipItem ( void  ) [protected, virtual]

Skip result item.

Implements impl::CResult.

Definition at line 1161 of file result.cpp.

References impl::CResult::GetDefineParams(), and m_CurrItem.

CDB_Object * CODBC_RowResult::x_LoadItem ( I_Result::EGetItem  policy,
CDB_Object item_buf 
) [protected]
CDB_Object * CODBC_RowResult::x_MakeItem ( void  ) [protected]
int CODBC_RowResult::xGetData ( SQLSMALLINT  target_type,
SQLPOINTER  buffer,
SQLINTEGER  buffer_size 
) [protected]

Friends And Related Function Documentation

friend class CODBC_Connection [friend]

Reimplemented in CODBC_ParamResult, and CODBC_StatusResult.

Definition at line 729 of file interfaces.hpp.

friend class CODBC_CursorCmd [friend]

Definition at line 728 of file interfaces.hpp.

friend class CODBC_CursorCmdExpl [friend]

Definition at line 730 of file interfaces.hpp.

friend class CODBC_LangCmd [friend]

Definition at line 726 of file interfaces.hpp.

friend class CODBC_RPCCmd [friend]

Reimplemented in CODBC_ParamResult, and CODBC_StatusResult.

Definition at line 727 of file interfaces.hpp.

friend class CODBC_SendDataCmd [friend]

Definition at line 731 of file interfaces.hpp.


Member Data Documentation

unsigned int CODBC_RowResult::m_CmdNum [private]

Definition at line 818 of file interfaces.hpp.

Definition at line 828 of file interfaces.hpp.

Referenced by CODBC_RowResult(), ReadItem(), x_LoadItem(), x_MakeItem(), and ~CODBC_RowResult().

Definition at line 817 of file interfaces.hpp.

Referenced by Fetch(), and ~CODBC_RowResult().

Definition at line 832 of file interfaces.hpp.

Referenced by Fetch(), and ReadItem().

Definition at line 831 of file interfaces.hpp.

Referenced by Fetch(), and ReadItem().

Definition at line 829 of file interfaces.hpp.

Referenced by CODBC_RowResult(), and Fetch().

Definition at line 815 of file interfaces.hpp.


The documentation for this class was generated from the following files:
Modified on Wed Sep 17 18:26:26 2014 by modify_doxy.py rev. 426318