| ★ wanayoo — archive 1999 http://wdvl.com/Authoring/DB/Intro/dbi_intro.html | Nouvelle recherche | Portail wanayoo |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Using Perl 5 and the DBI Module to Communicate With DatabasesOctober 19, 1998
However, for purposes of demonstration, in this part we will show an example of writing a CGI script in Perl 5, using the DBI (Database Independent Interface) module supplied for free with the normal Perl 5 distribution. As an example, our DBI-aware Perl 5 CGI Script will be used to access an MS Access Database on a Windows 95 system using a local web server called Sambar. Of course, as we will see in just a bit, the fact that we use Perl 5 and the DBI module means, that the code we develop here will work on UNIX, NT or Macintosh without any modifications. It will also work "out of the box" for most commercial and public domain databases available for the web including Oracle, Sybase, Informix, Postgres, DB2, etc. Finally, you should know that you need not use Sambar as your Web Server. Any Web Server that can handle CGI will do. I am just using Sambar because it is free and it is what I happened to download. In retrospect, I would probably recommend Apache since it is available on so many platforms. In short, the beauty of Perl and of the DBI module is that they are both designed to be highly cross platform and non-proprietary. (Note that since you are a web developer, I am assuming that you already know Perl 5 for CGI. If you don't, or if you need a refresher, check out Web Ware at WDVL! The e-zine has tutorials on Perl and Perl 5 for web developers.)
Introduction to Databases for the Web | Table of Contents The DBI Module |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Instantly look up a "techie" word using
Webopedia!!
|
![]() |
![]() |
Copyright 1999 internet.com Corporation. Legal Notices. Privacy Policy.