NCBI C++ ToolKit
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CODBCContext Class Reference

Search Toolkit Book for CODBCContext

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

+ Inheritance diagram for CODBCContext:
+ Collaboration diagram for CODBCContext:

Public Member Functions

 CODBCContext (SQLLEN version=SQL_OV_ODBC3, int tds_version=80, bool use_dsn=false)
 
virtual ~CODBCContext (void)
 
virtual bool IsAbleTo (ECapability cpb) const
 Check if a driver is acle to provide necessary functionality. More...
 
virtual string GetDriverName (void) const
 
void SetPacketSize (SQLUINTEGER packet_size)
 
SQLUINTEGER GetPacketSize (void) const
 
SQLHENV GetODBCContext (void) const
 
const CODBC_ReporterGetReporter (void) const
 
int GetTDSVersion (void) const
 
bool GetUseDSN (void) const
 
bool CheckSIE (int rc, SQLHDBC con, const CODBC_Reporter &opening_reporter)
 
void SetupErrorReporter (const CDBConnParams &params)
 
- Public Member Functions inherited from impl::CDriverContext
virtual ~CDriverContext (void)
 
virtual bool SetMaxBlobSize (size_t nof_bytes)
 Set maximal size for BLOB data. More...
 
bool SetMaxTextImageSize (size_t nof_bytes)
 
virtual bool SetLoginTimeout (unsigned int nof_secs=0)
 Set login timeout. More...
 
virtual unsigned int GetLoginTimeout (void) const
 Get login timeout. More...
 
virtual bool SetTimeout (unsigned int nof_secs=0)
 Set connection timeouts. More...
 
virtual unsigned int GetTimeout (void) const
 Get connection timeout. More...
 
virtual bool SetCancelTimeout (unsigned int nof_secs)
 
virtual unsigned int GetCancelTimeout (void) const
 
virtual void SetApplicationName (const string &app_name)
 Set application name. More...
 
virtual string GetApplicationName (void) const
 Return application name. More...
 
virtual void SetHostName (const string &host_name)
 Set host name. More...
 
virtual string GetHostName (void) const
 Get host name. More...
 
virtual CDB_ConnectionMakeConnection (const CDBConnParams &params)
 Create connection object using Load Balancer / connection factory. More...
 
virtual unsigned int NofConnections (const string &srv_name="", const string &pool_name="") const
 Return number of currently open connections in this context. More...
 
virtual unsigned int NofConnections (const TSvrRef &svr_ref, const string &pool_name="") const
 
virtual void PushCntxMsgHandler (CDB_UserHandler *h, EOwnership ownership=eNoOwnership)
 Add message handler "h" to process 'context-wide' (not bound to any particular connection) error messages. More...
 
virtual void PopCntxMsgHandler (CDB_UserHandler *h)
 Remove message handler "h" and all handlers above it in the stack. More...
 
virtual void PushDefConnMsgHandler (CDB_UserHandler *h, EOwnership ownership=eNoOwnership)
 Add `per-connection' err.message handler "h" to the stack of default handlers which are inherited by all newly created connections. More...
 
virtual void PopDefConnMsgHandler (CDB_UserHandler *h)
 Remove `per-connection' mess. handler "h" and all above it in the stack. More...
 
void CloseUnusedConnections (const string &srv_name=kEmptyStr, const string &pool_name=kEmptyStr, unsigned int max_closings=kMax_UInt)
 close reusable deleted connections for specified server and/or pool More...
 
const CDBHandlerStackGetConnHandlerStack (void) const
 
const CDBHandlerStackGetCtxHandlerStack (void) const
 
virtual void SetClientCharset (const string &charset)
 
const stringGetClientCharset (void) const
 
EEncoding GetClientEncoding (void) const
 
bool IsMultibyteClientEncoding (void) const
 
size_t GetMaxBlobSize (void) const
 
size_t GetMaxTextImageSize (void) const
 
void ReadDBConfParams (const string &service_name, SDBConfParams *params)
 
bool SatisfyPoolMinimum (const CDBConnParams &params)
 
void CloseConnsForPool (const string &pool_name)
 
void CloseOldIdleConns (unsigned int max_closings, const string &pool_name=kEmptyStr)
 
- Public Member Functions inherited from I_DriverContext
virtual ~I_DriverContext (void)
 
bool SetMaxTextImageSize (size_t n)
 
CDB_ConnectionConnect (const string &srv_name, const string &user_name, const string &passwd, TConnectionMode mode, bool reusable=false, const string &pool_name=kEmptyStr)
 Create new connection to specified server (or service) within this context. More...
 
CDB_ConnectionConnectValidated (const string &srv_name, const string &user_name, const string &passwd, IConnValidator &validator, TConnectionMode mode=0, bool reusable=false, const string &pool_name=kEmptyStr)
 Create new connection to specified server (within this context). More...
 

Protected Member Functions

virtual impl::CConnectionMakeIConnection (const CDBConnParams &params)
 
NCBI_NORETURN void ReportError (CDB_Exception &ex) const
 
- Protected Member Functions inherited from impl::CDriverContext
 CDriverContext (void)
 
virtual SSystemMutex & x_GetCtxMtx (void) const
 
CDB_ConnectionMakeCDBConnection (CConnection *connection)
 
CDB_ConnectionMakePooledConnection (const CDBConnParams &params)
 Create connection object WITHOUT using of Load Balancer / connection factory. More...
 
void DestroyConnImpl (CConnection *impl)
 
void CloseAllConn (void)
 
void DeleteAllConn (void)
 
CDBHandlerStackGetCtxHandlerStack (void)
 
void UpdateConnMaxBlobSize (void) const
 
void UpdateConnTimeout (void) const
 
void SetExtraMsg (const string &msg) const
 
const stringGetExtraMsg (void) const
 
- Protected Member Functions inherited from I_DriverContext
 I_DriverContext (void)
 
- Protected Member Functions inherited from impl::CWinSock
 CWinSock (void)
 
 ~CWinSock (void)
 

Private Member Functions

void x_AddToRegistry (void)
 
void x_RemoveFromRegistry (void)
 
void x_SetRegistry (CODBCContextRegistry *registry)
 
void x_Close (bool delete_conn=true)
 

Private Attributes

SQLHENV m_Context
 
SQLUINTEGER m_PacketSize
 
CODBC_Reporter m_Reporter
 
bool m_UseDSN
 
CODBCContextRegistrym_Registry
 
int m_TDSVersion
 

Friends

class CDB_Connection
 
class CODBCContextRegistry
 

Additional Inherited Members

- Public Types inherited from I_DriverContext
enum  EConnectionMode { fBcpIn = 0x1, fPasswordEncrypted = 0x2, fDoNotConnect = 0x4 }
 Connection mode. More...
 
enum  ECapability { eBcp, eReturnBlobDescriptors, eReturnITDescriptors = eReturnBlobDescriptors, eReturnComputeResults }
 Report if the driver supports this functionality. More...
 
typedef int TConnectionMode
 
- Static Public Member Functions inherited from impl::CDriverContext
static void ResetEnvSybase (void)
 
- Protected Types inherited from impl::CDriverContext
typedef list< CConnection * > TConnPool
 

Detailed Description

Definition at line 162 of file interfaces.hpp.

Constructor & Destructor Documentation

CODBCContext::CODBCContext ( SQLLEN  version = SQL_OV_ODBC3,
int  tds_version = 80,
bool  use_dsn = false 
)
CODBCContext::~CODBCContext ( void  )
virtual

Definition at line 378 of file context.cpp.

References NCBI_CATCH_ALL_X, NCBI_CURRENT_FUNCTION, and x_Close().

Member Function Documentation

bool CODBCContext::CheckSIE ( int  rc,
SQLHDBC  con,
const CODBC_Reporter opening_reporter 
)
string CODBCContext::GetDriverName ( void  ) const
virtual

Reimplemented from I_DriverContext.

Definition at line 436 of file context.cpp.

SQLHENV CODBCContext::GetODBCContext ( void  ) const
inline

Definition at line 196 of file interfaces.hpp.

References m_Context.

Referenced by CODBC_Connection::CODBC_Connection().

SQLUINTEGER CODBCContext::GetPacketSize ( void  ) const
inline

Definition at line 191 of file interfaces.hpp.

References m_PacketSize.

Referenced by CODBC_Connection::x_SetConnAttributesBefore().

const CODBC_Reporter& CODBCContext::GetReporter ( void  ) const
inline

Definition at line 200 of file interfaces.hpp.

References m_Reporter.

Referenced by CODBC_Connection::CODBC_Connection().

int CODBCContext::GetTDSVersion ( void  ) const
inline

Definition at line 204 of file interfaces.hpp.

References m_TDSVersion.

bool CODBCContext::GetUseDSN ( void  ) const
inline

Definition at line 209 of file interfaces.hpp.

References m_UseDSN.

Referenced by CODBC_Connection::x_Connect().

virtual bool CODBCContext::IsAbleTo ( ECapability  cpb) const
inlinevirtual

Check if a driver is acle to provide necessary functionality.

Parameters
cpbFunctionality to query about.
Returns
  • true if functionality is present
  • false if no such functionality.

Implements I_DriverContext.

Definition at line 179 of file interfaces.hpp.

impl::CConnection * CODBCContext::MakeIConnection ( const CDBConnParams params)
protectedvirtual

Implements impl::CDriverContext.

Definition at line 373 of file context.cpp.

NCBI_NORETURN void CODBCContext::ReportError ( CDB_Exception ex) const
inlineprotected

Definition at line 221 of file interfaces.hpp.

References m_Reporter, and CODBC_Reporter::ReportError().

void CODBCContext::SetPacketSize ( SQLUINTEGER  packet_size)

Definition at line 442 of file context.cpp.

References m_PacketSize, and impl::CDriverContext::x_GetCtxMtx().

void CODBCContext::SetupErrorReporter ( const CDBConnParams params)
void CODBCContext::x_AddToRegistry ( void  )
private

Definition at line 350 of file context.cpp.

References CODBCContextRegistry::Add(), and m_Registry.

Referenced by CODBCContext().

void CODBCContext::x_Close ( bool  delete_conn = true)
private
void CODBCContext::x_RemoveFromRegistry ( void  )
private

Definition at line 358 of file context.cpp.

References m_Registry, and CODBCContextRegistry::Remove().

Referenced by x_Close().

void CODBCContext::x_SetRegistry ( CODBCContextRegistry registry)
private

Definition at line 366 of file context.cpp.

References m_Registry, and registry.

Referenced by CODBCContextRegistry::Remove().

Friends And Related Function Documentation

friend class CDB_Connection
friend

Definition at line 166 of file interfaces.hpp.

friend class CODBCContextRegistry
friend

Definition at line 240 of file interfaces.hpp.

Member Data Documentation

SQLHENV CODBCContext::m_Context
private

Definition at line 227 of file interfaces.hpp.

Referenced by CODBCContext(), GetODBCContext(), and x_Close().

SQLUINTEGER CODBCContext::m_PacketSize
private

Definition at line 228 of file interfaces.hpp.

Referenced by GetPacketSize(), and SetPacketSize().

CODBCContextRegistry* CODBCContext::m_Registry
private

Definition at line 231 of file interfaces.hpp.

Referenced by x_AddToRegistry(), x_RemoveFromRegistry(), and x_SetRegistry().

CODBC_Reporter CODBCContext::m_Reporter
private
int CODBCContext::m_TDSVersion
private

Definition at line 232 of file interfaces.hpp.

Referenced by GetTDSVersion().

bool CODBCContext::m_UseDSN
private

Definition at line 230 of file interfaces.hpp.

Referenced by GetUseDSN().


The documentation for this class was generated from the following files:
Modified on Sun Jun 25 17:49:35 2017 by modify_doxy.py rev. 533848