I want to write an application which should be able to connect to multiple databases (this will be configured by parameters at startup). The application will have different queries for each database engine, this is not a problem.
The problem is that I want to be able to connect to different database engines. Java has JDBC, Perl has DBI. What does C++ have?
What's more I don't want to use database drivers with too strict licences (commercial ones). GPL could be - but I'd like to avoid that.
Virtually every database engine in existence provides an ODBC interface. I think JDBC is actually a clone of ODBC.
What you want, then, is a C++ wrapper for the ODBC API, that implements RAII to make sure that database resources are released in case of exception, etc. For example: http://simpledb.sourceforge.net/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With