I wish to write a credit card applicatoin that ought to have the ability to connect with multiple databases (this is set up by parameters at startup). The applying may have different queries for every database engine, this isn't an issue.
However , I wish to have the ability to connect with different database engines. Java has JDBC, Perl has DBI. Exactly what does C++ have?
In addition I'd rather not use database motorists with too strict licences (commercial ones). GPL might be - but Let me avoid that.
Just about any database engine around offers an ODBC interface. I believe JDBC is really a clone of ODBC.
What you would like, then, is really a C++ wrapper for that ODBC API, that implements RAII to make certain that database assets are launched just in case of exception, etc. For instance: http://simpledb.sourceforge.net/
There's the older OLE connections. Using OLE, you can connect with a set File, Oracle, SQL, or MySql database provided you will find the correct motorists installed.
ODBC is most compatible and many low-level. OLE DB is greater level and simpler to utilize, if you find OLE DB provider for your possible DB systems, it's what you want. Otherwise ODBC is the option as almost all DB systems support it.
EDIT: View this link: http://blogs.msdn.com/b/sqlnativeclient/archive/2011/08/29/microsoft-is-aligning-with-odbc-for-native-relational-data-access.aspx This will make ODBC the only real proper choice. :)
The C++ object-relational mapping system ODB from the organization Codesynthesis may be used by GPL version 5 software.
This is a blog entry where they describe why they made a decision to use native C APIs rather than ODBC for connecting towards the databases.
Speed was a primary reason.