The traditional way of doing SQL for Relational Databases in C++ is something like this:
con.Connect(
"testDB", // database name
"user", // user name
"password", // password
DBClient) ;
con.Execute("Select * from test where users = 0") ;
//... handle data
con.Disconnect() ;
All within a Try Catch exception handler.
SOCI lets you do it like this:
string name;
int salary;
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.
Comments
No comments yet. Leave a Comment

