Initializing the library


Detailed Description

To use OCILIB, it first needs to be initialized through a call to OCI_Initialize().

Then, the application connects to server, executes queries, ....

Finally, OCILIB resources must be released by OCI_Cleanup()

Note:
The following objects are automatically freed by the library :
Warning:
All other standalone object instances (mutexes, threads, dates, lobs, ...) ARE NOT freed.
Example
#include "ocilib.h"

int main(void)
{
    if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
        return EXIT_FAILURE;

    /* ... application code here ... */

    OCI_Cleanup();

 
    return EXIT_SUCCESS;
}


Functions

OCI_EXPORT boolean OCI_API OCI_Initialize (POCI_ERROR err_handler, const mtext *home, unsigned int mode)
 Initializes the library.
OCI_EXPORT boolean OCI_API OCI_Cleanup (void)
 Clean up all resources allocated by the library.
OCI_EXPORT unsigned int OCI_API OCI_GetOCICompileVersion (void)
 Return the version of OCI used for compilation.
OCI_EXPORT unsigned int OCI_API OCI_GetOCIRuntimeVersion (void)
 Return the version of OCI used at runtime.
OCI_EXPORT unsigned int OCI_API OCI_GetImportMode (void)
 Return the Oracle shared library import mode.
OCI_EXPORT unsigned int OCI_API OCI_GetCharsetMetaData (void)
 Return the metadata charset type.
OCI_EXPORT unsigned int OCI_API OCI_GetCharsetUserData (void)
 Return the user data charset type.


Function Documentation

OCI_EXPORT boolean OCI_API OCI_Cleanup ( void   ) 

Clean up all resources allocated by the library.

Note:
This function must be the last OCILIB library function call.

Returns:
TRUE

Definition at line 1103 of file library.c.

OCI_EXPORT unsigned int OCI_API OCI_GetCharsetMetaData ( void   ) 

Return the metadata charset type.

Note:
Possible values are :

Definition at line 1238 of file library.c.

OCI_EXPORT unsigned int OCI_API OCI_GetCharsetUserData ( void   ) 

Return the user data charset type.

Note:
Possible values are :

Definition at line 1247 of file library.c.

OCI_EXPORT unsigned int OCI_API OCI_GetImportMode ( void   ) 

Return the Oracle shared library import mode.

Note:
Possible values are:

Definition at line 1229 of file library.c.

OCI_EXPORT unsigned int OCI_API OCI_GetOCICompileVersion ( void   ) 

Return the version of OCI used for compilation.

Note:
  • with linkage build option, the version is determined from the oci.h header through different ways
  • with runtime loading buid option, the version is set to the highest version of OCI needed by OCILIB, not necessarily the real OCI version

Definition at line 1211 of file library.c.

OCI_EXPORT unsigned int OCI_API OCI_GetOCIRuntimeVersion ( void   ) 

Return the version of OCI used at runtime.

Note:
  • with linkage build option, the version is determined from the oci.h header through different ways
  • with runtime loading build option, the version determined from the symbols dynamically loaded.

Definition at line 1220 of file library.c.

Referenced by OCI_GetVersionConnection().

OCI_EXPORT boolean OCI_API OCI_Initialize ( POCI_ERROR  err_handler,
const mtext *  home,
unsigned int  mode 
)

Initializes the library.

Parameters:
err_handler - Pointer to error handler procedure (optional)
home - Oracle home path (optional)
mode - Environment mode
Possible values for parameter mode:

Note:
This function must be called before any OCILIB library function.

Warning:
If the parameter 'home' is NULL, the Oracle library is loaded from system environment variables
Returns:
TRUE on success otherwise FALSE (only with Oracle runtime loading mode if the oracle shared libraries can't be loaded)

Definition at line 443 of file library.c.


Generated on Thu Jul 30 17:41:53 2009 for OCILIB (C Driver for Oracle) by  doxygen 1.5.4