[Tutor] python and MS Access db's

dman dsh8290@rit.edu
Wed, 20 Mar 2002 21:41:50 -0600


On Wed, Mar 20, 2002 at 09:51:14PM -0500, Erik Price wrote:
| 
| On Wednesday, March 20, 2002, at 01:34  PM, dman wrote:
| 
| >I'm going to create my own server on the windows machine using
| >MS' ODBC driver to connect to the db, and then use either XML-RPC or
| >CORBA to connect to that server from the linux box.
| 
| I just started learning about XML-RPC myself.  I'm interested in it, and 
| if you don't mind my asking, why you are planning to use XML-RPC over 
| SOAP.

XML-RPC is rather lightweight.  I've heard that SOAP has
feature-creep.  I actually looked at both of them.  It appears that
XML-RPC only allows passing of primitive data between the processes.
I want to pass a object references (cursors, dates, times, and other
random stuff).  I think, but can't find any definitive documentation
indicating or refuting, that SOAP can pass object references around.
It looks a bit more involved and not as transparent as I'd like,
though.

At the moment it looks like I'll be going with CORBA.  I found
python-enabled win32 binaries for omniORB, and also saw comments to
the effect that ORBit works on windows.  I didn't find any binaries
for ORBit or orbit-python, and a MS compiler will be a must since I'll
need the python binary to access MS' ODBC or COM stuff.  (I can't use
gcc and the/a cygwin-enabled python)  To use CORBA I'll either need to
find a name server somewhere that both ORBs can use, or perhaps blend
in a little something else (I don't know, XML-RPC or just a plain
socket) to get the IOR for the initial object from.

Any comments, experiences, anecdotes, or pointers to documentation are
welcome :-).

| I have a MySQL database (fortunately I don't have to deal with the 
| headache of proprietary drivers!)

Yeah, nice.

| The custom web client was originally going to be designed to open up a 
| socket connection and communicate directly "in Python" with the Python 
| CGI script that would be sitting on the server with the MySQL 
| connection.

This sounds like an odd architecture to me.

Normally a CGI script is executed by a web server.  Input is given
either in the environment variable QUERY_STRING or on stdin.  The
output will be returned to the web browser, and thus ought to be some
sort of content the browser can handle sanely.

What I don't understand with the description you've given so far is
    What sort of data do you need to move through that socket?  
    What are the purposes of each process using that socket?

| This is a pretty quick way to do it, but I'm starting to 
| think that if I make the CGI script capable of working in XML-RPC
| (or SOAP), and have the web client talk to it in that language, then
| it'll be a little less work someday if I ever need to write a client
| in Java, 

Keep the java in your coffee mug.  Believe me, if you get into java
you'll _really_ love python afterwards!

| or if someone else wants to access the database from ASP (a lot of 
| people I work with use ASP).  So I'm just starting to learn about 
| XML-RPC and SOAP, and wanted to hear your thoughts about it.

Depends on what the client will be, who will use it, and what its
purpose is.  If you're just looking to get stuff out of a (open) SQL
db, then ODBC or JDBC will likely be your best middleware.  Otherwise
you'll need to rig something to bridge the gap (like I need to do).

| This doesn't sound like such a difficult little program, does it?

If all you're doing is creating an HTML view of a collection of images
on-disk, it could be done with just a not-too-complex CGI script
without any dbs or distributed objects.

I think expanding on what the requirements of the system are and
thinking about what roles each component will serve will help to clear
up some of the vagueness.

-D

-- 

No harm befalls the righteous,
but the wicked have their fill of trouble.
        Proverbs 12:21