Python and Databases

Gerhard Häring gh at ghaering.de
Mon May 19 16:54:40 EDT 2003


Geraldo Lopes de souza wrote:
> Hi,
> 
>    I'm not a python programmer, but I like the language. I have read the
> manuals installed and played a little with wxPython (a nice library), I'm a
> Delphi programmer, I work making database applications. I have considered to
> change to python, because it's a superior language, productive, expressive,
> etc.
> 
>   From time to time I stop and try to do this, but I face one thing: The
> lack of multi-database library. I think that this block many people from
> making this change. If you're going to use just one database then ok, but if
> you want to use more than one, you have just one choice: the mxODBC package.
> It looks like a great package , it worths the price, but with java for
> example, I get more much more ( in library terms) for less.

Really? All you get with Java is the JDBC standard, with dozens of 
implementations (which is not entirely unlike things are done in 
Pythonia). Java's interfaces are of course stronger than the interfaces 
of Python (which in this case, is the DB-API specification).

>   I don't intend to attack or be rude with the commercial package , but I
> have seen many discussion of the acceptance of python to make business
> applications.
>  To increase this the python community needs a standard ODBC library in the
> language.

I strongly disagree. An ODBC library (which Microsoft considers 
obsolete, btw.) has no place in the Python standard library, let alone 
the Python language. The best argument against is that there is 
practically nobody who'd be able to maintain such a beast (for free).

>  You might say: Go for java. We are happy the way we are. For the answer I
> say, I like python more than java. When I get my hands in java I say : This
> would be a lot simpler if were done in python.

You know you can access Java libraries using Jython? Jython is an 
alternative implementation of Python that runs under the Java Virtual 
Machine.

>   You might say: Why don't you develop such library ? I haven't enough
> knowledge to do this, but I would test, a library like this. What I (imho)
> think the community needs, is an effort to make python to talk with
> databases in an uniform way. I know there is the DB API but we need ODBC.
> ODBC is the standard way of communicating with databases, if you create a
> database the first thing you need is an odbc driver to make the existing
> applications to talk with your database.
> 
> What do you think, ? Please post your points.

Ok, here's what I think Python needs. A standard library *on top of* 
DB-API modules that is higher-level and provides nice ways for 
integration with GUI and web frameworks. Something like ADO.NET.

More later, if this thread will continue :)

-- Gerhard





More information about the Python-list mailing list