advice for perl expert wanting to learn python

David Fraser davidf at sjsoft.com
Tue Aug 24 04:54:02 EDT 2004


Keith Farmer wrote:
> David Fraser <davidf at sjsoft.com> wrote in message news:<cevpef$bku$1 at ctb-nnrp2.saix.net>...
> 
>>Zeljko Vrba wrote:
> 
> 
>>>And most important thing, how does Python deal with database connectivity?
>>>Is there a single API (akin to DBI) for connecting to databases?
> 
> 
>>I have used Oracle, SQLServer and Access via ADO - try adodpapi.sf.net 
>>which is a wrapper for ADO to the Python DB-API.
>>But note that you may well not be able to use any of this database stuff 
>>from IronPython
> 
> 
> Assuming you find yourself working with .NET -- as you would with
> IronPython -- I would expect it to have access to the stock database
> namespaces under whatever environment you're in: under MS's
> implementation of .NET, System.Data.* (same under Mono?).  This would
> be the most likely line, since there's a lot of prior work in .NET
> that targets that namespace, including UI controls.
> 
> For documentation, search for "ADO.NET".  It's actually a pretty good
> framework, and doesn't require a database connection to make use of it
> (ie, you want an in-memory database, but don't need persistent
> storage).
> 
> I don't know what Jim's planning to do with the Python db api, but
> between the two, I'd personally use ADO.NET when available.  I'd
> suggest the IronPython email list (www.ironpython.org) for more
> information.

The disadvantage of using ADO.NET is that you'll lose the portability 
advantages of the Python db API (i.e. you'll only be able to use the 
code on IronPython).
The correct approach is to write a DB API-compatible wrapper for ADO.NET 
:-) (as has been done for ADO)

David



More information about the Python-list mailing list