oracle interface

M.-A. Lemburg mal at egenix.com
Thu Apr 7 15:17:51 EDT 2005


Andrew Dalke wrote:
> In searching I find there several different ways to
> connect to an Oracle server on MS Windows:
> 
>   mxODBC - http://www.egenix.com/files/python/mxODBC.html
>     built on top of the ODBC drivers for a given database

mxODBC works nicely with Oracl on Windows. There are
two options:

1. MS Oracle ODBC driver:

   This is the MS version of an ODBC driver for Oracle.
   It is well integrated into MS transaction managers,
   authentication and other MS techniques, but doesn't
   support all the the 8i and 9i features.

2. Oracle ODBC driver:

   This driver is supported by Oracle itself and does
   have support for 8i and 9i.

If these don't work for you, there are also a number
of commercial ODBC driver kits which support Oracle
from the usual suspects (OpenLink, EasySoft, DataDirect,
etc.).

Usage is pretty straightforward:

a) install the ODBC driver
b) create an ODBC data source (this connects the ODBC
   driver with the database you want to talk to)
c) install egenix-mx-base and egenix-mx-commercial
d) fire up Python...

from mx.ODBC.Windows import DriverConnect
dbc = DriverConnect("DSN=<datasourcename>;UID=<username>;PWD=<password>")
c = dbc.cursor()
c.execute('select * from mytable')
print c.fetchall()

If you like it, contact sales at egenix.com and we'll let you
know what else is needed :-)

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Apr 07 2005)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the Python-list mailing list