[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-db-sig
Subject:    [DB-SIG] Connect vs. connect
From:       mal () lemburg ! com (M ! -A !  Lemburg)
Date:       2000-03-13 9:00:48
Message-ID: 38CCAE40.32B8A35D () lemburg ! com
[Download RAW message or body]

Peter Bittner wrote:
> 
> Hi there!
> 
> > db = MySQLdb.connect(db='mydb',user='myuser',passwd='mypasswd')
> 
> Why is connect an function in MySQLdb, whereas in DCOracle it is a
> constructor Connect. - Where is the API compatibility gone?
> 
> > db = DCOracle.Connect(username + '/' + pwd + '@' + system)
> 
> DCOracle supports the Python API 1.0 not 2.0, is that the reason?

No, DB API 1.0 states to use the name of the module as constructor.
DB API 2.0 defines .connect(). The name .Connect() is either DC's
own invention or came from early versions of the DB API 2.0.

FYI, mxODBC provides .connect() and an alias .Connect() as well
as the DB API 1.0 names for each of the subpackages, e.g.
ODBC.iODBC.iODBC(...).

> Peter
> 
> | Peter H. Bittner
> | International Student at Aston University
> | e-mail: bittneph@aston.ac.uk
> | web: http://beam.to/bimbo
> +--------------------------
> 
> _______________________________________________
> DB-SIG maillist  -  DB-SIG@python.org
> http://www.python.org/mailman/listinfo/db-sig

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic