Simplified database connectivity with DBI
DBI or the database interface for Perl is a Perl package that allows a developer to access different databases uniformly. In a proprietary-based environment where the developer is engaged in a platform like asp.net consulting service, the database interfaces are preferentially set to a certain database management system (for example, MS-SQL Server). However, in the open-source environment with PHP or Perl platforms, the database interfaces are uniformly set for different databases with plug-in utilities so that programmers can use independent SQL code to interact with the database.
Every database vendor uses different library functions to set the rules for database access. So, in an organization engaged in software outsourcing services, the programmers will have to write different set of codes to call the library functions, passing queries, retrieving data etc. for every new project. As a solution to this, the database Interface for Perl encapsulates the interaction process increasing the portability of different existing project modules. The DBI with the help of the DBD (database driver assigned for a specific database package) interacts with the database and gives the result back to the actual program.
DBD modules used by Perl DBI can interact with all known database management systems. For example, the DBD::Oracle connects to an Oracle database whereas the DBD::mysql can interact with a MySQL database. Moreover, for text-based CSV files, the Database Interface for Perl uses the DBD::CSV module. Unlike the .net application development platform, the database interface is homogeneous in nature (DBD::ODBC is used for Microsoft’s databases).
The DBI work process follows the following order:
Loading the DBI Establishing the database connection and loading the DBD Opening a cursor with a SQL statement Retrieving the result Closing the cursor Closing the database connection Exit
The DBI has helped Perl to evolve as a good programming language for open-source platform because of the simplicity, ease of use and the cost of deployment. Along with Perl’s regular expressions and syntactic constructs, DBI is surely a boon for all open-source programmers.
I am the webmaster at www.synapseindia.com – A web development company offering outsourcing services to businesses in India and abroad.












