The API has been tested to work with both MySql and PostGreSQL on a Debian Linux platform.
The API can be downloaded from our sourceforge project page.
The SimpleDB API is a C++ API designed to encapsulate the ODBC API functionality in an object oriented manner.
The API was created due to an absence of any other such API that was database independent. The database independence is achieved using the ODBC (Open DataBase Connectivity) API.
The API provides a Database object that can be used to create instances of Query objects. The Query objects are used to query a database and allow columns to be bound for the query.
The flowing column objects are currently available (as of Jan 2005): a boolean column, a long column and a string column. The string column makes use of the libstdc++ string class so you don't have to mess around with malloc.
The Database object also has some convenience member functions that allow queries that return a single integer or string to be executed without having to create a query object or bind columns.
The API has been tested to work with both MySql and PostGreSQL on a Debian Linux platform.
Example usage: see simple.cpp
Have a look at the Frequently Asked Questions. For any queries or to contact the developers, please go to our project page.
Make the query.execute() thread safe to ensure that threads with the same database handle cannot execute queries simultaneously (ODBC querying is NOT thread safe).
Investigate where the mutex needs to happen. Look at fetchRow() - it calls the ODBC world for its information (but this may have a unique Id which is thread safe