Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes

OCIPL::OracleServer Struct Reference

encapsulation of the OCIServer handle, used in OCIPL::OciLogin More...

#include <ocipl.h>

Inheritance diagram for OCIPL::OracleServer:
Inheritance graph
[legend]
Collaboration diagram for OCIPL::OracleServer:
Collaboration graph
[legend]

List of all members.

Public Types

typedef OciHandle< OCIServer > super
typedef OCIServer HandleType

Public Member Functions

 OracleServer (OciEnv &env)
 ~OracleServer ()
void attach (const tstring &tnsname)
void detach ()
void alloc ()
void destroy ()
void set_attribute (ub4 attrtype, const tstring &str)
void set_attribute (ub4 attrtype, ub4 value)
void set_attribute (ATTR &attr)
void get_attribute (dvoid *attributep, ub4 *sizep, ub4 attrtype)
void set_attribute_handle (ub4 attrtype, void *handle)
 operator HandleType * ()

Static Public Member Functions

static ub4 get_type_id ()
static ub4 get_attr_id ()

Public Attributes

TCHAR _version_string [2000]
OciEnv_env

Protected Attributes

HandleType_handle

Detailed Description

encapsulation of the OCIServer handle, used in OCIPL::OciLogin

Definition at line 802 of file ocipl.h.


Member Typedef Documentation

typedef OCIServer OCIPL::OciHandle< OCIServer >::HandleType [inherited]

Definition at line 563 of file ocipl.h.

Reimplemented from OCIPL::OciHandle< OCIServer >.

Definition at line 804 of file ocipl.h.


Constructor & Destructor Documentation

OCIPL::OracleServer::OracleServer ( OciEnv env ) [inline]

Definition at line 807 of file ocipl.h.

     :  super(env)
    {
#if ORACLE_VERSION>=82
        _version = 0;
#endif
        _version_string[0] = '\0';
    }
OCIPL::OracleServer::~OracleServer (  ) [inline]

Definition at line 817 of file ocipl.h.

    {
        if (_handle)
            detach();
    }

Member Function Documentation

void OCIPL::OciHandle< OCIServer >::alloc (  ) [inline, inherited]

Definition at line 596 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        if (_handle)
            destroy();

        sword res = OCIHandleAlloc(_env, (dvoid**)&_handle, super::get_type_id(), 0, 0);
        oci_check_error(_env, res);
    }

Here is the call graph for this function:

void OCIPL::OracleServer::attach ( const tstring tnsname ) [inline]

Definition at line 824 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCIServerAttach(_handle, _env._errh, (OraText*)tnsname.c_str(), (sb4)tnsname.length()*sizeof(TOraText), OCI_DEFAULT);
        oci_check_error(_env, res);

#if ORACLE_VERSION>=82
        res = OCIServerRelease(_handle, _env._errh, (OraText*)_version_string, sizeof(_version_string), OCI_HTYPE_SERVER, &_version);
#else
        res = OCIServerVersion(_handle, _env._errh, (OraText*)_version_string, sizeof(_version_string), OCI_HTYPE_SERVER);
#endif
        oci_check_error(_env, res);
    }

Here is the call graph for this function:

void OCIPL::OciHandle< OCIServer >::destroy (  ) [inline, inherited]

Definition at line 606 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCIHandleFree(_handle, super::get_type_id());
        _handle = 0;

        oci_check_error(_env, res);
    }

Here is the call graph for this function:

void OCIPL::OracleServer::detach (  ) [inline]

Definition at line 838 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCIServerDetach(_handle, _env._errh, OCI_DEFAULT);
        oci_check_error(_env, res);

#if ORACLE_VERSION>=82
        _version = 0;
#endif
        _version_string[0] = '\0';
    }

Here is the call graph for this function:

static ub4 OCIPL::OciHandleID< OCIServer >::get_attr_id (  ) [static, inherited]
void OCIPL::OciHandle< OCIServer >::get_attribute ( dvoid *  attributep,
ub4 *  sizep,
ub4  attrtype 
) [inline, inherited]

Definition at line 629 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCIAttrGet(_handle, super::get_type_id(), attributep, sizep, attrtype, _env._errh);
        oci_check_error(_env, res);
    }

Here is the call graph for this function:

static ub4 OCIPL::OciHandleID< OCIServer >::get_type_id (  ) [static, inherited]
OCIPL::OciHandle< OCIServer >::operator HandleType * (  ) [inline, inherited]

Definition at line 650 of file ocipl.h.

    {
        return _handle;
    }
void OCIPL::OciHandle< OCIServer >::set_attribute ( ub4  attrtype,
const tstring str 
) [inline, inherited]

Definition at line 615 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCIAttrSet(_handle, super::get_type_id(), (TOraText*)str.c_str(), (ub4)str.length()*sizeof(TOraText), attrtype, _env._errh);
        oci_check_error(_env, res);
    }

Here is the call graph for this function:

void OCIPL::OciHandle< OCIServer >::set_attribute ( ATTR &  attr ) [inline, inherited]

Definition at line 643 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCIAttrSet(_handle, super::get_type_id(), attr, 0, ATTR::get_attr_id(), _env._errh);
        oci_check_error(_env, res);
    }

Here is the call graph for this function:

void OCIPL::OciHandle< OCIServer >::set_attribute ( ub4  attrtype,
ub4  value 
) [inline, inherited]

Definition at line 622 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCIAttrSet(_handle, super::get_type_id(), (OraText*)&value, (ub4)sizeof(value), attrtype, _env._errh);
        oci_check_error(_env, res);
    }

Here is the call graph for this function:

void OCIPL::OciHandle< OCIServer >::set_attribute_handle ( ub4  attrtype,
void *  handle 
) [inline, inherited]

Definition at line 636 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCIAttrSet(_handle, super::get_type_id(), handle, 0, attrtype, _env._errh);
        oci_check_error(_env, res);
    }

Here is the call graph for this function:


Member Data Documentation

OciEnv& OCIPL::OciHandle< OCIServer >::_env [inherited]

Definition at line 659 of file ocipl.h.

HandleType* OCIPL::OciHandle< OCIServer >::_handle [protected, inherited]

Definition at line 656 of file ocipl.h.

Definition at line 852 of file ocipl.h.


The documentation for this struct was generated from the following file: