NCBI C++ ToolKit
Public Member Functions | Private Attributes | List of all members
impl::CDBBindedParams Class Reference

Search Toolkit Book for impl::CDBBindedParams

#include <dbapi/driver/impl/dbapi_driver_utils.hpp>

+ Inheritance diagram for impl::CDBBindedParams:
+ Collaboration diagram for impl::CDBBindedParams:

Public Member Functions

 CDBBindedParams (impl::CDB_Params &bindings, EOwnership ownership=eNoOwnership)
 
virtual unsigned int GetNum (void) const
 Get total number of columns in resultset. More...
 
virtual const stringGetName (const CDBParamVariant &param, CDBParamVariant::ENameFormat format=CDBParamVariant::eSQLServerName) const
 Get name of column. More...
 
virtual unsigned int GetIndex (const CDBParamVariant &param) const
 
virtual size_t GetMaxSize (const CDBParamVariant &param) const
 Get maximum size in bytes for column. More...
 
virtual EDB_Type GetDataType (const CDBParamVariant &param) const
 Get data type for column in the resultset. More...
 
virtual const CDB_ObjectGetValue (const CDBParamVariant &param) const
 Get value of column. More...
 
virtual EDirection GetDirection (const CDBParamVariant &param) const
 Get parameter's direction (in/out/inout). More...
 
virtual CDBParamsBind (const CDBParamVariant &param, CDB_Object *value, bool out_param=false)
 This method stores pointer to data. More...
 
virtual CDBParamsSet (const CDBParamVariant &param, CDB_Object *value, bool out_param=false)
 This method stores copy of data. More...
 
virtual CDBParamsSemiShallowClone (void) const
 Yield a lightweight copy of these parameters, sharing representations for variable-length datatypes. More...
 
- Public Member Functions inherited from CDBParams
virtual ~CDBParams (void)
 

Private Attributes

AutoPtr< impl::CDB_Paramsm_Bindings
 

Additional Inherited Members

- Public Types inherited from CDBParams
enum  EDirection { eIn , eOut , eInOut }
 

Detailed Description

Definition at line 102 of file dbapi_driver_utils.hpp.

Constructor & Destructor Documentation

◆ CDBBindedParams()

impl::CDBBindedParams::CDBBindedParams ( impl::CDB_Params bindings,
EOwnership  ownership = eNoOwnership 
)

Definition at line 122 of file dbapi_driver_utils.cpp.

Referenced by SemiShallowClone().

Member Function Documentation

◆ Bind()

CDBParams & impl::CDBBindedParams::Bind ( const CDBParamVariant param,
CDB_Object value,
bool  out_param = false 
)
virtual

◆ GetDataType()

EDB_Type impl::CDBBindedParams::GetDataType ( const CDBParamVariant param) const
virtual

Get data type for column in the resultset.

Parameters
paramColumn number or name

Implements CDBParams.

Reimplemented in impl::CCachedRowInfo.

Definition at line 160 of file dbapi_driver_utils.cpp.

References eDB_UnsupportedType, CDB_Object::GetType(), GetValue(), and NULL.

◆ GetDirection()

CDBParams::EDirection impl::CDBBindedParams::GetDirection ( const CDBParamVariant param) const
virtual

Get parameter's direction (in/out/inout).

Parameters
paramColumn number or name

Implements CDBParams.

Reimplemented in impl::CCachedRowInfo.

Definition at line 176 of file dbapi_driver_utils.cpp.

References DATABASE_DRIVER_ERROR, and CDBParams::eIn.

◆ GetIndex()

unsigned int impl::CDBBindedParams::GetIndex ( const CDBParamVariant param) const
virtual
Parameters
paramColumn number or name
Returns
Number of a columnn, which is corresponding to a name.

Implements CDBParams.

Reimplemented in impl::CCachedRowInfo.

Definition at line 145 of file dbapi_driver_utils.cpp.

References CDBParamVariant::GetName(), impl::CDB_Params::GetParamNum(), CDBParamVariant::GetPosition(), CDBParamVariant::IsPositional(), and m_Bindings.

Referenced by GetValue().

◆ GetMaxSize()

size_t impl::CDBBindedParams::GetMaxSize ( const CDBParamVariant param) const
virtual

Get maximum size in bytes for column.

Parameters
colColumn number or name
Returns
Max number of bytes needed to hold the returned data.

Implements CDBParams.

Reimplemented in impl::CCachedRowInfo.

Definition at line 154 of file dbapi_driver_utils.cpp.

References DATABASE_DRIVER_ERROR.

◆ GetName()

const string & impl::CDBBindedParams::GetName ( const CDBParamVariant param,
CDBParamVariant::ENameFormat  format = CDBParamVariant::eSQLServerName 
) const
virtual

Get name of column.

This method is returning const reference because meta-info MUST be cached for performance reasons.

Parameters
paramColumn number or name

Implements CDBParams.

Reimplemented in impl::CCachedRowInfo.

Definition at line 134 of file dbapi_driver_utils.cpp.

References CDBParamVariant::GetName(), impl::CDB_Params::GetParamName(), CDBParamVariant::GetPosition(), CDBParamVariant::IsPositional(), and m_Bindings.

◆ GetNum()

unsigned int impl::CDBBindedParams::GetNum ( void  ) const
virtual

Get total number of columns in resultset.

Returns
total number of columns in resultset

Implements CDBParams.

Reimplemented in impl::CCachedRowInfo.

Definition at line 128 of file dbapi_driver_utils.cpp.

References m_Bindings, and impl::CDB_Params::NofParams().

◆ GetValue()

const CDB_Object * impl::CDBBindedParams::GetValue ( const CDBParamVariant param) const
virtual

Get value of column.

Parameters
paramColumn number or name

Implements CDBParams.

Definition at line 166 of file dbapi_driver_utils.cpp.

References GetIndex(), impl::CDB_Params::GetParam(), i, m_Bindings, and NULL.

Referenced by GetDataType().

◆ SemiShallowClone()

CDBParams * impl::CDBBindedParams::SemiShallowClone ( void  ) const
virtual

Yield a lightweight copy of these parameters, sharing representations for variable-length datatypes.

Implements CDBParams.

Definition at line 236 of file dbapi_driver_utils.cpp.

References CDBBindedParams(), eTakeOwnership, m_Bindings, and impl::CDB_Params::SemiShallowClone().

Referenced by impl::CBaseCmd::SaveInParams().

◆ Set()

CDBParams & impl::CDBBindedParams::Set ( const CDBParamVariant param,
CDB_Object value,
bool  out_param = false 
)
virtual

Member Data Documentation

◆ m_Bindings

AutoPtr<impl::CDB_Params> impl::CDBBindedParams::m_Bindings
private

Definition at line 136 of file dbapi_driver_utils.hpp.

Referenced by Bind(), GetIndex(), GetName(), GetNum(), GetValue(), SemiShallowClone(), and Set().


The documentation for this class was generated from the following files:
Modified on Wed Apr 17 13:08:16 2024 by modify_doxy.py rev. 669887