Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages | Examples

Simple C++ ODBC Database API Documentation

The API has been tested to work with both MySql and PostGreSQL on a Debian Linux platform.

Version:
__BEGIN_VERSION 1.5 __END_VERSION
Date
2006/01/05 00:31:15

Download

The API can be downloaded from our sourceforge project page.

API Description

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

Further Info

Have a look at the Frequently Asked Questions. For any queries or to contact the developers, please go to our project page.

Todo:
Make the query object inherit from stringstream so queries can be streamed into a query.

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).

When the query is executed, it will execute it's internal string. The stream could have io stream modifiers which tell the stream to escape what comes after.(e.g instead of calling db->escapeString()) Additionally you could make the stream convert boolean values to the right ones for a given database. Almost a locale for database, could use facets on the stream.

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


Copyright (C) 2005 Eminence Technology Pty Ltd.
Documentation pages generated by doxygen.

SourceForge.net Logo