tags:

views:

358

answers:

6

I'm going to be developing a C++ application that uses a MySQL database.

I've written similar apps in Java using JDBC, as well as the Spring Framework.

Are there equivalent libraries for C++? What have you had the most success with?

+1  A: 

There's the MySQL Connector C++ project from MySQL. It's still in early alpha releases, but it does mimic the JDBC 4.0 model.

Grant Limberg
This will be used in a production environment - note the disclaimer on the Connector C++ site:MySQL Connector/C++ is available as an alpha version. We kindly ask users and developers to try it out and provide us with feedback. We do not encourage you to use it in production environments, though.
Clayton
A: 

It looks like writing a data access layer using the MySQL C API is going to be the best bet.

Clayton
+1  A: 

I have enjoyed working with SQLAPI++.

ayaz
A: 

I found QtSql to be easy to use.

gsarkis
A: 

MySQL Connector/C++ is a C++ implementation of JDBC 4.0

The reference customers who use MySQL Connector/C++ are:
- OpenOffice - MySQL Workbench

Learn more: http://forums.mysql.com/read.php?167,221298

+2  A: 

I would use the MySQL C API, it is the simplest solution. You can easily write a class to wrap up the C api for your own uses.

chris.moos
+1, you also get to retain more hair in the process :)
Tim Post