Home | OS/2 Software | Rexx | Access and manipulate a database (Advanced level)

Access and manipulate a database (Advanced level)

Contributed by: Doug Rickman, Global Hydrology and Climate Center, MSFC, NASA

This is aimed at advanced REXX users.

This is a functioning program, part of the ELASII image processing and remote sensing package. The program allows a user to access and manipulate a database about an ELAS data file. The package uses named pipes, mutex and event semaphores, and threads. A test ELAS datafile with database is included.

A zipfile containing the source may be downloaded here.

Abandon hope, all yee who enter here!

Newsgroup note that led to this submission:

I have a set of code that you probably could simply take and use almost verbatim, assuming you seriously need to FORCE serial access to a file.

I did this by creating a "databaseserver" program that on starting accesses a database. Programs that need to talk to the database actually talk to the server. This is isolated into a suite of subroutines (DatabaseSetup, _Talker, _Read, and _Write) which I simply drop into programs as needed.

The server has a timer thread that kills the server if the program that started the server dies without killing the server. Communication from program to server is via a named pipe.