DBI


The Perl DBI (Database Interface) module is a database independent programming interface for database programming. The DBI can actually be separated into 2 distinct sections;

The DBI

The DBI provides the definition of the DBI programming interface, and ensures that any database call is sent to the correct driver. Additionally, the DBI contains the additional support code to maintain these services.

To use DBI within a Perl program, it is as simple as adding the following line to the Perl code:

This loads the DBI module. Indvidual database driver modules are then loaded when required.

The Drivers

The DBI drivers (also called database drivers or DBDs), are database specific, and each different type of database will be supported by a specific driver for that type of database. The drivers carry out all the actual operations on the databases. The advantage of this approach is that there is a clear separation between the drivers and the DBI. This means that it is relatively easy to support most databases, just by calling (or where neccessary, creating) a new driver for that particular database.

There are a host of drivers available for the Perl DBI, and the following list, provides a sample of those available:

Handles

Resources



www.cyberthinc.com