[Tfug] mySQL use

Jim Secan jim at nwra-az.com
Tue Dec 23 09:02:17 MST 2003


I've got some old Fortran code that I need to drag into the late 20th
century by replacing its clunky old ASCII column-file "databases" with
mySQL.  The problem is the linkage between the code and the database.  Two
generic options I know of:  (1) write the interface code in C or C++ using
the mySQL API library and link these into the Fortran executable (I'm using
the Lahey compiler), or (2) write from the Fortran into ASCII flat files
and write some utility codes in whatever language makes sense to load the
database from these files.  Option #2 on the ingest side would just run in
the opposite direction (utilities to build flat files to be read by the
Fortran app).

I realize that there are other options using pipes and spawning processes
from within the Fortran code, but I need this to be portable (*nix and
windoze) so tricksy OS-specific solutions are verbotten.  In a pinch, I
might consider something along these lines, isolating the OS-specific codes
in a handful of routines, but this not the preferred approach.

Any experience on which of these alternatives is the least painful?  I've
also heard rumors of linking Fortran and Java (which would be my choice)
into a single executable, but nothing firm.  And no, rehosting the Fortran
code to some other language is not an option (yet).

TIA, and Merry Christmas.
Jim
*---------------------*-------------------------------*
| Jim Secan           | Northwest Research Assoc, Inc |
| (jim at nwra-az.com)   | 2455 E. Speedway, Suite 203   |
| (520) 319-7773      | Tucson, Arizona 85719         |
|    Space Weather Info: http://www.nwra-az.com/      |
*---------------------*-------------------------------*


More information about the tfug mailing list