1

I like the idea of JDBC for Java and DB-API for Python, which both provide uniform APIs for accessing different relational database management systems.

What is it like in C?

Is there uniform API in C for different RDBMS'?

I haven't found one, or I might miss it. Is such an effort successful? POSIX doesn't seem to define a uniform API to access RDBMS'.

Thanks.

Note: I tried to read about libpq in C for postgresql, but felt the postgresql-specific API was complex, compared to JDBC and DB-API. I haven't checked the sqlite-specific or mysql-specific API yet, but expect them not similar to the one by libpq.

Tim
  • 1
  • 141
  • 372
  • 590
  • 1
    ODBC? Isn't that where JDBC got the name from? – Lundin Aug 30 '18 at 12:01
  • Thanks. Do you happen to know if ODBC is popular for postgresql, sqlite, and mysql under Linux, given that ODBS was created by Microsoft, compared to directly using RDMBS-specific drivers in Linux? If not, what is more popular? – Tim Aug 30 '18 at 12:34
  • There's libdbi but it looks dead as there hasn't been an update and barely any commits in years. I think you'll find in C on Linux/Unix people just use the native API for whatever database they're using. ODBC might get more use in the Windows world? – Shawn Aug 30 '18 at 17:36

1 Answers1

1

In 1989, Oracle, Informix, Ingres, DEC, Tandem, Sun, and HP formed the SQL Access Group and defined the Call Level Interface to allow C (and COBOL) programs to access SQL databases. Nowadays, this interface specification is managed not by POSIX but by ISO/IEC (and thus part of the official SQL standard), and has also been implemented by all other SQL databases.

Microsoft's implementation of the CLI is known as "ODBC" (and has extensions). And as your question shows, nobody knows the acronym "CLI", so the implementations on other OSes also call themselves "ODBC" (e.g., , ). Outside of Windows, they are not very widespread.

CL.
  • 173,858
  • 17
  • 217
  • 259
  • Thanks. Nothing is popular in Linux? I asked the question, because I want to learn to program to use RDBMS in C (mostly in Linux), but don't want to get lost in the DBMS-specific parts of different APIs. – Tim Sep 01 '18 at 17:46