Database Requirements

From InterBase
Jump to: navigation, search

Go Up to Requirements for all Applications


All applications that work with databases must provide one database handle for each database to be accessed. A database handle is a long pointer that is used in API functions to attach to a database and to reference it in subsequent API calls. The InterBase header file, ibase.h, contains a #define useful for declaring database handles.

When establishing a connection to a database, optional database attachment characteristics, such as a user name and password combination, can be passed to the attachment through a database parameter buffer (DPB). Usually, one DPB is set up for each database attachment, although database attachments can also share a DPB.


You Must Declare Database Handles

A database handle must be declared and initialized to zero before use. The following code illustrates how to declare and initialize a database handle:

#include <ibase.h>
. . .
/* Declare a database handle. */
isc_db_handle db1;
. . .
/* Initialize the handle. */
db1 = 0L;

For more information about declaring, initializing, and using database handles, see Working with Databases.


Setting up a DPB

A DPB is a byte array describing optional database attachment characteristics. A DPB must be set up and populated before attaching to a database. Parameters that can be passed to the DPB are defined in ibase.h.

For more information about setting up, populating, and using a DPB, see Working with Databases.

Advance To: