Python, NT, and databases

M.-A. Lemburg mal at lemburg.com
Mon Sep 27 17:31:33 EDT 1999


Brady Montz wrote:
> 
> I'm due to give a talk on a project to link cgi scripts on solaris to SQL
> Server running on NT (why ask why? just don't). Perl was used, and was as fun
> as ever.
> 
> I'm curious if there's any way this could have been written in python, and how
> reliable it would have been.
> 
> We didn't use ODBC drivers, using the perl dbiproxy module instead (for those
> lucky ignorant ones, dbiproxy runs perl code on the NT machine with the
> database, and has a proxy on the unix machine so that the cgi script can just
> use the regular perl dbd module to access the database as if it were
> local). Is something like this possible/plausible/pleasant with python? Or at
> least no less pleasant than with perl (dbiproxy doesn't work very well - for
> one thing it's not multithreaded so you can only have one connection to the DB
> per port).

Writing such a proxy should be easy with the standard SocketServer.py
module. Apart from a native approach you could also use one of the
many RPC type systems available for Python, e.g. Fnorb (CORBA), ILU,
XML-RPC (see www.pythonware.com) plus at least a dozen others that
were cooked up by many different people (just scan the newsgroup
with dejanews).

> If we had used ODBC drivers (which weren't easy to find for solaris), how well
> does python talk to them?

You could try mxODBC (see my Python Pages) which provides access to
ODBC on Unix, Windows and might even do the trick on Macs too. Then
take an ODBC driver setup construction kit from InterSolv or OpenLink
or try the ODBC bridge from EasySoft to access the NT Server.
 
> Finally, does anyone have experience, good or bad, writing cgi scripts in
> python plugged into a NT webserver?

I've had reports that it works rather well. Haven't tested it myself
though.

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






More information about the Python-list mailing list