[ Previous ] [ Contents ] [ Index ] [ Next ]

Ns_PdDbInit

Overview

Call any dbms-specific initialization routines.

Syntax

    void * Ns_PdDbInit (void);

Description

This function is called once from the 'nspdmain' when the database driver is initialized at process startup. It normally allocates and returns a dbms-specific structure to be passed to all other routines. It also calls any dbms-specific initialization routines. This function does not open a connection to the database.

Psuedo-code Example

    /* Things italicized would be your DBMS-specific structures and 
calls. */
    void *
    Ns_PdDbInit(void)
    {
        DBMSState *state;
        int status = NS_OK;
        if ((state = (DBMSState *)malloc(sizeof(DBMSState))) != NULL) 
{
        /* Allocate or initialize other DBMS specific data */
        /* ... */
        if (status == NS_ERROR) {
            return NULL;
        } else {
            return (void *)state;
        }
    }

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1998-99 America Online, Inc.