Developing Database Drivers for AOLserver -- Introduction

### Introduction

A database driver is a module that interfaces between the AOLserver database-independent nsdb API and the API of a particular DBMS. A database driver provides implementations of a standard set of functions for doing such things as opening connections to the database, sending SQL statements, returning results to a standard form, and closing connections. AOLserver takes care of managing collections of open database connections called database pools.

Database driver modules look much like ordinary AOLserver modules but are loaded differently. Instead of being listed with other modules in the ns/server/server-name/modules section of the configuration file, a database driver is listed in the ns/db/drivers section -- a database driver is not tied to a particular virtual server. The database driver initialization function must call Ns_DbRegisterDriver() with an array of pointers to functions. These functions are then later used by AOLserver to perform database operations. The virtual server initialization function is called each time nsdb is loaded into a virtual server. The server initialization function (Ns_dbms-nameServerInit) adds the Tcl command ns_dbms-name to the server's Tcl interpreters. The ns_dbms-name command can then be used to fetch driver-specific information about an active connection.

NOTE: The above naming scheme is simply based on convention. It is not enforced, and can be changed at the programmer's discretion.

Top of Page
Copyright © 1998-99 America Online, Inc.