C++ – How to create database connectivity through C++


In C++, how can I establish an SQL connection to store data in an SQL database?

Best Solution

You should have a look at C preprocessors that exists traditionaly with databases (ecpg for postgres, Pro*C for oracle ... which lets you embed straight SQL directly in your source files) or an orginal system for mysql. ECPG will do with C++, that is/was not the case for some other preprocessors ...