Connection Fortran to MySQL database

Is in Fortran possible to connect to a database (e.g. MySQL)?

I want to develop a Fortran calculation application. This application should be able to connect with a MySQL database. The next steps are:

  1. read data from a table by SQL queries,
  2. Execute calculations
  3. Result of these calculations should be stored in the database

Thanks in advance for your help

3 Likes

Welcome @eric.bakker to the Discourse!

Yes, in @Arjen Markus’ book Modern Fortran in Practice, the chapter 6 is “Interfacing to C: SQLite as an example”:
http://fortranwiki.org/fortran/show/Modern+Fortran+in+Practice
The Fortran code can be found here:
http://flibs.sourceforge.net/examples_modern_fortran.html

5 Likes

Actually, my Flibs project at http://flibs.sourceforge.net contains a module (by Daniel Kraft) for connecting with MySQL directly. It is not as extensive as the SQLite one, but it ought to be useful as a beginning.

2 Likes

Thank you for your reply

1 Like