|
constexpr | Environment () noexcept |
|
| Environment (ODBC::Version version) noexcept |
|
ODBC::Version | Version () const |
|
void | SetVersion (ODBC::Version version) const |
|
ODBC::ConnectionPooling | ConnectionPooling () const |
|
void | SetConnectionPooling (ODBC::ConnectionPooling connectionPooling) const |
|
Result | DataSources (ODBC::FetchOrientation direction, SQLWCHAR *datasourceName, SQLSMALLINT datasourceNameMaxLength, SQLSMALLINT *datasourceNameActualLength, SQLWCHAR *datasourceDescription, SQLSMALLINT datasourceDescriptionMaxLength, SQLSMALLINT *datasourceDescriptionActualLength) const |
|
Result | DataSources (ODBC::FetchOrientation direction, SQLCHAR *datasourceName, SQLSMALLINT datasourceNameMaxLength, SQLSMALLINT *datasourceNameActualLength, SQLCHAR *datasourceDescription, SQLSMALLINT datasourceDescriptionMaxLength, SQLSMALLINT *datasourceDescriptionActualLength) const |
|
std::vector< ODBC::DataSource > | DataSources (ODBC::FetchOrientation direction=ODBC::FetchOrientation::First) const |
|
Result | Drivers (ODBC::FetchOrientation direction, SQLWCHAR *driverDescription, SQLSMALLINT driverDescriptionMaxLength, SQLSMALLINT *driverDescriptionActualLength, SQLWCHAR *driverAttributes, SQLSMALLINT driverAttributesMaxLength, SQLSMALLINT *driverAttributesActualLength) const |
|
std::vector< ODBC::Driver > | Drivers (ODBC::FetchOrientation direction) const |
|
Result | EndTransaction (ODBC::TransactionCompletionType completionType) const |
|
Result | Commit () const |
|
Result | Rollback () const |
|
ODBC::Connection | CreateConnection () const |
|
template<SimpleWideStringLike StringT> |
ODBC::Connection | Connect (const StringT &datasourceName) const |
|
template<SimpleWideStringLike StringT1, SimpleWideStringLike StringT2> |
ODBC::Connection | Connect (const StringT1 &datasourceName, const StringT2 &userName) const |
|
template<SimpleWideStringLike StringT1, SimpleWideStringLike StringT2, SimpleWideStringLike StringT3> |
ODBC::Connection | Connect (const StringT1 &datasourceName, const StringT2 &userName, const StringT3 &authenticationString) const |
|
Public Member Functions inherited from Harlinn::ODBC::SqlHandle< ODBC::HandleType::Environment > |
constexpr | SqlHandle () noexcept |
|
| SqlHandle (const SqlHandle &other)=delete |
|
constexpr | SqlHandle (SqlHandle &&other) noexcept |
|
| ~SqlHandle () |
|
SqlHandle & | operator= (const SqlHandle &other)=delete |
|
constexpr SqlHandle & | operator= (SqlHandle &&other) noexcept |
|
constexpr SQLHANDLE | Handle () const noexcept |
|
void | Close () noexcept |
|
Result | Cancel () const |
|
Result | CompleteAsync (RETCODE *asyncRetCode) const |
|
|
void | SetAttribute (SQLINTEGER attributeId, SQLPOINTER value, SQLINTEGER valueLength) const |
|
void | GetAttribute (SQLINTEGER attributeId, SQLPOINTER value, SQLINTEGER allocatedLength, SQLINTEGER *valueLength) const |
|
void | SetUInt32Attribute (SQLINTEGER attributeId, UInt32 value) const |
|
UInt32 | GetUInt32Attribute (SQLINTEGER attributeId) const |
|
Protected Member Functions inherited from Harlinn::ODBC::SqlHandle< ODBC::HandleType::Environment > |
constexpr | SqlHandle (SQLHANDLE sqlHandle, bool destructorClosesHandle) noexcept |
|
void | SetHandle (SQLHANDLE sqlHandle, bool destructorClosesHandle) |
|
void | ThrowException (SQLRETURN sqlReturn) const |
|
void | ThrowException (SQLRETURN sqlReturn, const wchar_t *function, const wchar_t *file, int line) const |
|
The Environment class is a wrapper for the ODBC environment handle.
An environment is a global context in which to access data; associated with an environment is any information that is global in nature, such as:
-
The environment's state
-
The current environment-level diagnostics
-
The handles of connections currently allocated on the environment
-
The current settings of each environment attribute
Within a piece of code that implements ODBC (the Driver Manager or a driver), an environment handle identifies a structure to contain this information.
Environment handles are not frequently used in ODBC applications. They are always used in calls to SQLDataSources and SQLDrivers and sometimes used in calls to SQLAllocHandle, SQLEndTran, SQLFreeHandle, SQLGetDiagField, and SQLGetDiagRec.
Each piece of code that implements ODBC (the Driver Manager or a driver) contains one or more environment handles. For example, the Driver Manager maintains a separate environment handle for each application that is connected to it. Environment handles are allocated with SQLAllocHandle and freed with SQLFreeHandle.