C++ SQL数据库库比较[英] C++ SQL database library comparison

本文是小编为大家收集整理的关于C++ SQL数据库库比较的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。


我正在开始在一个必须使用Microsoft SQL Server数据库的中等规模的C ++项目上开发.在使用.NET Technologies之前,我已经完成了数据库工作,但是这次我找不到使用.NET方法是合适的.我想获得有关各种免费(如GPL,LGPL,BOOST)C ++ SQL库可获得的一些反馈.我发现MySQL ++和Soci非常有趣,我想知道你们喜欢哪个以及为什么.

另外,尽管该项目主要是在Windows Workstation上运行的,但我更喜欢在Linux下进行开发,因此跨平台兼容性是一个优势.



编辑:对不起,对错字,我的意思是Microsoft SQL Server,而不是MySQL Server.


我强烈推荐 otl .

它不仅支持所有主要的DB,而且还非常Stl-ish,并且通常根据适当的C ++方法(IMO)编写.它对我的效果很好(我使用了MySQL ODBC连接器).





我推荐 sqlapi ++ .它是共享软件,因此您可以免费尝试,并且支持非常出色.适用于Windows和Linux.



I am starting development on a medium-scale C++ project that has to work with a Microsoft SQL Server database. I have done database work before using .NET technologies but I don't find using a .NET approach to be appropriate this time. I would like to get some feedback concerning the various free (as in GPL, LGPL, Boost) C/C++ SQL libraries available. I found MySQL++ and SOCI to be pretty interesting and I would like to know which one you guys prefer and why.

Also, although this project will primarily be run on Windows workstations, I prefer developing under Linux so cross-platform compatibility is an advantage.

Thank you all for your time, I really appreciate your advices !


EDIT : Sorry about the typo, I meant Microsoft SQL Server and not MySQL Server.


I can highly recommend OTL.

Not only does it support all major DBs, it's also very STL-ish and is generally written according to to proper C++ methodology (IMO). It worked for me just fine on VC8 (I used the MySQL ODBC connector).

Moreover, it's a one-header library. So there's no linkage issues or anything. Just include the header and you're done. You're 3 lines of code away from querying a MySQL table.

I've used it over the past few months, and also had a good experience communicating with its developer, asking questions, etc.


I recommend SQLAPI++. It's shareware so you can try it for free and the support is excellent. Works for Windows and Linux.