tags:

views:

113

answers:

5

I'm looking for options for abstracting database server details away from my application (in c++), I'd like to write my code to be independent of the actual database backend. I know MySQL has a nice library, but I don't want to be tied to a single database implementation. Are there good options for this?

+1  A: 

many apps use odbc (via unixODBC for instance), there's also otl. on windows you could use ado.net from managed c++ or the old ado com interfaces...

jspcal
+2  A: 

SOCI is good. Supports multiple databases, works well, modern C++ style API, works with boost.

janm
+1  A: 

Qt provides a database abstraction layer. See: http://doc.trolltech.com/4.6/qsqldatabase.html.

Kyle Lutz
+1  A: 

libodbc++ provides a pretty good API. Also the big guys Qt (see Kyle Lutz' answer) & wxWidgets have db abstraction layers, so it may be a good idea to use them if you plan to use/you're already using any other parts of those frameworks.

Eugen Constantin Dinca
+1  A: 
Tom