File Information
Library: Data/ODBC
Package: ODBC
Header: Poco/Data/ODBC/ConnectionHandle.h
Description
ODBC connection handle class
Member Summary
Member Functions: connect, disconnect, getTimeout, handle, isConnected, operator bool, operator const SQLHDBC &, pHandle, setTimeout
Constructors
ConnectionHandle
ConnectionHandle(
const std::string & connectString = "",
SQLULEN timeout = 5
);
Creates the ConnectionHandle.
Destructor
~ConnectionHandle
~ConnectionHandle();
Creates the ConnectionHandle.
Member Functions
connect
bool connect(
const std::string & connectString = "",
SQLULEN timeout = 5
);
Connects the handle to the database.
disconnect
bool disconnect();
Disconnects the handle from database.
getTimeout
int getTimeout() const;
Returns the connection timeout in seconds.
handle
const SQLHDBC & handle() const;
Returns const reference to handle;
isConnected
bool isConnected() const;
Returns true if connected.
operator bool
operator bool();
Returns true if handles are not null. True value is not a guarantee that the connection is valid.
operator const SQLHDBC &
operator const SQLHDBC & () const;
Const conversion operator into reference to native type.
pHandle
const SQLHDBC * pHandle() const;
Returns const pointer to handle;
setTimeout
void setTimeout(
SQLULEN timeout
);
Sets the connection timeout in seconds.