Python Database Interfaces - Any Standard?

Brian Knox brianknox at home.com
Sun Dec 24 17:11:50 EST 2000


The Perl DBI consists of two parts: the non database specific DBI module
(DBI.pm). Then there is a DBD (DataBase Driver) module for each database.
So, if I wanted to say work with Oracle, I'd use DBI.pm and the Oracle DBD.

use DBI;
$dbh = DBI->connect( $dbi:Oracle:archaeo", "username", "password" );

To switch to say PostgreSQL, just change "Oracle" to "Pg" and make sure you
have the DBD.

Brian

"Erno Kuusela" <erno-news at erno.iki.fi> wrote in message
news:kuk88pu0cd.fsf at lasipalatsi.fi...
> >>>>> "Brian" == Brian Knox <brianknox at home.com> writes:
>
> it's ofcourse not possible to have a single module cover all databases
> since the various databases have different protocols for talking to
> them (modulo odbc/jdbc). well, unless the single module contained code
> for every conceivable database, but that would hardly be sensible.
>
>   -- erno






More information about the Python-list mailing list