SDTS_AL
Public Member Functions | List of all members
CPLODBCSession Class Reference

#include <cpl_odbc.h>

Public Member Functions

 CPLODBCSession ()
 
 ~CPLODBCSession ()
 
int EstablishSession (const char *pszDSN, const char *pszUserid, const char *pszPassword)
 
const char * GetLastError ()
 
int ClearTransaction ()
 
int BeginTransaction ()
 
int CommitTransaction ()
 
int RollbackTransaction ()
 
int IsInTransaction ()
 
int CloseSession ()
 
int Failed (int, HSTMT=NULL)
 
HDBC GetConnection ()
 
HENV GetEnvironment ()
 

Detailed Description

A class representing an ODBC database session.

Includes error collection services.

Constructor & Destructor Documentation

CPLODBCSession::CPLODBCSession ( )

Constructor

CPLODBCSession::~CPLODBCSession ( )

Destructor

Member Function Documentation

int CPLODBCSession::BeginTransaction ( )

Begin transaction

int CPLODBCSession::ClearTransaction ( )

Clear transaction

int CPLODBCSession::CloseSession ( )

Close session

int CPLODBCSession::CommitTransaction ( )

Commit transaction

int CPLODBCSession::EstablishSession ( const char *  pszDSN,
const char *  pszUserid,
const char *  pszPassword 
)

Connect to database and logon.

Parameters
pszDSNThe name of the DSN being used to connect. This is not optional.
pszUseridthe userid to logon as, may be NULL if not not required, or provided by the DSN.
pszPasswordthe password to logon with. May be NULL if not required or provided by the DSN.
Returns
TRUE on success or FALSE on failure. Call GetLastError() to get details on failure.
int CPLODBCSession::Failed ( int  nRetCode,
HSTMT  hStmt = NULL 
)

Test if a return code indicates failure, return TRUE if that is the case. Also update error text.

HDBC CPLODBCSession::GetConnection ( )
inline

Return connection handle

HENV CPLODBCSession::GetEnvironment ( )
inline

Return GetEnvironment handle

const char * CPLODBCSession::GetLastError ( )

Returns the last ODBC error message.

Returns
pointer to an internal buffer with the error message in it. Do not free or alter. Will be an empty (but not NULL) string if there is no pending error info.
int CPLODBCSession::IsInTransaction ( )
inline

Returns whether a transaction is active

int CPLODBCSession::RollbackTransaction ( )

Rollback transaction


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