C++ bindings for MySQL

无人久伴 提交于 2019-12-31 05:26:14

问题


I'm running OSX(10.4.11) & I'm trying to get a decent C(preferably C++) binding for MySQL figured out. I have some data in an offsite database I want to analyze.

I'm trying to get MySQL++ working, but it's being funky.

I'm looking for other bindings, preferably ones with a no-headache install.

edit:

MySQL has C bindings. Clunky and low-level, but it works(after some library fiddling).

http://www.sqlapi.com/ supports Solaris/Windows/Linux.


回答1:


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:


The SQLApi++ has been ported to OS/X by this guy, as part of a REALBasic plugin. He may be open to licensing it.

I don't know why it hasn't been licensed back to them. Maybe they are not interested in supporting Mac clients.




回答3:


You might want to look at SOCI. Although it builds upon the MySQL C API, it presents a much nicer C++-friendly interface than using the C bindings.




回答4:


There is mysql++. I've used it with one of our c++ projects.




回答5:


How is MySQL++ being funky for you?




回答6:


Personally I've used mymysql in the past (still do if I'm working in C++) it's a lightweight wrapper around the C api and ties memory management to object lifetimes.

It can be found here: http://www.redi.uklinux.net/mymysql/

Despite the warnings on the site, it's still not a bad library. It was actually written by a former colleague and despite him not really maintining it anymore it's still in fairly good shape.




回答7:


I've never had any problems using the MySQL C library.



来源:https://stackoverflow.com/questions/220756/c-bindings-for-mysql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!