Ns_PdDbInit

Name

Ns_PdDbInit -- 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.

Pseudo-code Example

/* DBMSState is 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;
    }
  }
}