Poco::Data::ODBC

class ConnectionHandle

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 inline

const SQLHDBC & handle() const;

Returns const reference to handle;

isConnected

bool isConnected() const;

Returns true if connected.

operator bool inline

operator bool();

Returns true if handles are not null. True value is not a guarantee that the connection is valid.

operator const SQLHDBC & inline

operator const SQLHDBC & () const;

Const conversion operator into reference to native type.

pHandle inline

const SQLHDBC * pHandle() const;

Returns const pointer to handle;

setTimeout

void setTimeout(
    SQLULEN timeout
);

Sets the connection timeout in seconds.