A C++ wrapper for SQLite 3, easy to use.
Follow SQLitePP
Other Useful Business Software
Our Free Plans just got better! | Auth0
You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Rate This Project
Login To Rate This Project
User Reviews
-
// a simple example to use SQLitePP void simple_example() { //define a connection SQLitePP::DBConnection conn; // connect to a database int rc = conn.connect("D:\\mytestdb.db"); if (rc != 0) { std::cout << conn.getErrorMessage() << std::endl; return; } // define a command and set a command text SQLitePP::DBCommand cmd(&conn); cmd.setCommandText("create table tbl_test(id integer not null, name text, contact text)"); rc = cmd.execute(); // execute if (rc != 0) { std::cout << conn.getErrorMessage() << std::endl; return; } // insert data cmd.setCommandText("insert into tbl_test(id, name, contact) values(0, 'gavin', 'vxling@gmail.com')"); rc = cmd.execute(); // execute if (rc != 0) { std::cout << conn.getErrorMessage() << std::endl; return; } // execute a query cmd.setCommandText("select * from tbl_test"); rc = cmd.execute(); // execute if (rc != 0) { std::cout << conn.getErrorMessage() << std::endl; return; } // print all result while (cmd.fetchNext()) { std::cout << cmd.field(0) << ", " << cmd.field(1) << std::endl; } }