If you could find drivers for your platform, ODBC was supposedly designed for just that: a platform-independent way of talking to the database.
(I claim that in my experience, ODBC is such a mess that connecting to an ODBC driver is more difficult than just writing code three times for three different databases.)
source share