OGR
|
#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 () |
A class representing an ODBC database session.
Includes error collection services.
CPLODBCSession::CPLODBCSession | ( | ) |
Constructor
CPLODBCSession::~CPLODBCSession | ( | ) |
Destructor
References CloseSession().
int CPLODBCSession::BeginTransaction | ( | ) |
Begin transaction
References Failed().
int CPLODBCSession::ClearTransaction | ( | ) |
Clear transaction
References Failed().
Referenced by CPLODBCStatement::ExecuteSQL(), CPLODBCStatement::GetColumns(), CPLODBCStatement::GetPrimaryKeys(), and CPLODBCStatement::GetTables().
int CPLODBCSession::CloseSession | ( | ) |
Close session
References CPLError(), and IsInTransaction().
Referenced by EstablishSession(), and ~CPLODBCSession().
int CPLODBCSession::CommitTransaction | ( | ) |
Commit transaction
References Failed().
int CPLODBCSession::EstablishSession | ( | const char * | pszDSN, |
const char * | pszUserid, | ||
const char * | pszPassword | ||
) |
Connect to database and logon.
pszDSN | The name of the DSN being used to connect. This is not optional. |
pszUserid | the userid to logon as, may be NULL if not not required, or provided by the DSN. |
pszPassword | the password to logon with. May be NULL if not required or provided by the DSN. |
References CloseSession(), CPLDebug(), and Failed().
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.
References RollbackTransaction().
Referenced by BeginTransaction(), ClearTransaction(), CommitTransaction(), and EstablishSession().
|
inline |
Return connection handle
Referenced by CPLODBCStatement::CPLODBCStatement().
|
inline |
Return GetEnvironment handle
const char * CPLODBCSession::GetLastError | ( | ) |
Returns the last ODBC error message.
|
inline |
Returns whether a transaction is active
Referenced by CloseSession(), CPLODBCStatement::ExecuteSQL(), CPLODBCStatement::GetColumns(), CPLODBCStatement::GetPrimaryKeys(), and CPLODBCStatement::GetTables().
int CPLODBCSession::RollbackTransaction | ( | ) |
Rollback transaction
Referenced by Failed().