The traditional way of doing SQL for Relational Databases in C++ is something like this:
"testDB", // database name
"user", // user name
"password", // password
con.Execute("Select * from test where users = 0") ;
//... handle data
All within a Try Catch exception handler.
SOCI lets you do it like this:
sql << "select name, salary from persons where id = " << id,
into(name), into(salary) ;
Which you have to admit is a lot easier to understand. SOCI is an open source library with dual licencing and works with MySQL, ODBC, Oracle, PostgreSQL and SQLite3
- Permanent link added to Cross Platform C++ Software.