Database Access Libraries for C++

2019-03-11 09:31发布

Background:

I have an application written in native C++ which uses the wxWidgets toolkit's wxODBC database access library which is being removed from all future versions of wxWidgets . I need to replace this with another database access method that supports the assumptions and contraints outlined below. I don't require that the replacement use native DBMS APIs or ODBC under the hood, but it must meet the contraints outlined below.

Assumptions/Constraints

The library must:

  • Support Native (i.e. unmanaged) C++
  • 32-bit Windows 2000/XP/2003
  • Visual Studio 2005
  • Microsoft SQL Server 2000 and 2005
  • Oracle 9 and 10
  • Run-time Performance greater than or equal to wxODBC
  • Single programmer API supporting multiple DBMS (e.g. don't want to write different code for using different DBMS)

Nice but Optional:

  • 64-bit Windows operating systems
  • 32-bit and/or 64-bit Linux operating systems
  • Microsoft SQL Server 2008
  • Oracle 11
  • MySQL
  • Any additional DBMS
  • Visual Studio 2008
  • Open Source
  • Runtime Performance near or equal to native DBMS API

Question:

What good libraries are available - either free, open source or pay - that support multiple DBMS from a single API including Oracle and Microsoft SQL Server and can be used from native C++?

Please describe any past experiences you have had - good OR bad - with a given library and why you are making your recommendation for or against a given library, especially in regards to the assumptions and contraints above.

See Also:

https://stackoverflow.com/questions/74141/good-orm-for-c-solutions

5条回答
时光不老,我们不散
2楼-- · 2019-03-11 09:47

A library is http://otl.sourceforge.net/

An employer of mine used it.

I can't tell you how its performance compares with wxODBC, but it might fit your requirements.

查看更多
劳资没心,怎么记你
3楼-- · 2019-03-11 09:51

You can use SOCI http://soci.sourceforge.net or also Wt::Dbo, http://www.webtoolkit.eu and look at the Wt::Dbo component.

查看更多
Anthone
4楼-- · 2019-03-11 09:57

You can check Debea - SQL Database Access and ORM for C++. It has API for wxWidgets built-in.

查看更多
爷的心禁止访问
5楼-- · 2019-03-11 09:59

I use SQLAPI++. Well worth a look.

http://www.sqlapi.com/

查看更多
Anthone
6楼-- · 2019-03-11 09:59

Qt is also an option. It supports the connections to the servers you want, and quite simple to use.

http://doc.trolltech.com/4.4/sql-driver.html#supported-databases

When using Qt, you don't need to build against all Qt. You can for example just use the SQL part, and leave the whole GUI part outside.

Since it has been recently LGPL-ed, you can also use it for a proprietary application.

查看更多
登录 后发表回答