How to connect to Firebird from C++


There are several options.

1. ODBC - this should be your last option if nothing else works. Firebird ODBC drivers mostly work, but do some testing with various datatypes before you go into it. No access to Firebird API.

2. Use the C API directly. This approach is fastest, but also error prone. Documentation for C API is not very user friendly, and sometimes you'll need to ask questions at support lists.

3. Use some C++ wrapper:


3.a. Many have reported great success with IBPP. It's a mature open source project with a lot of users (administration tool FlameRobin for example). IBPP is very clean and easy to use C++ library. Supports all Firebird functionality, Services API, etc. Works on Windows, Linux, Mac OS X, FreeBSD, Solaris, and probably all other Firebird supported platforms. Actively developed and maintained.

http://www.ibpp.org


3.b. DatabaseLayer

DatabaseLayer provides a JDBC-like interface to database I/O. So far only SQLite3, PostgreSQL, MySQL, Firebird, and ODBC database backends are supported. MiniCppUnit unit tests are used to make it easier to add more database backends in the future. It is built upon wxWidgets, so it can be an interesting choice if you develop wx applications.

http://wxcode.sourceforge.net/components/databaselayer/


3.c. SOCI

Open Source, Boost license. Supports Oracle, PostgreSQL, Firebird, MySQL, SQLite, MS SQL Server (via ODBC).

http://soci.sourceforge.net/


3.d. SQLAPI++

If you aim for cross-platform support with multiple database systems (Oracle, MSSQL, Postgres, ...) there is a commercial SQLAPI++ library. We haven't had time to play with it yet, as we're only interested in Firebird support and IBPP works like a charm.

SQLAPI++ authors, please contact us if you wish your product reviewed here.


Do you find this FAQ incorrect or incomplete? Please e-mail us what needs to be changed. To ensure quality, each change is checked by our editors (and often tested on live Firebird databases), before it enters the main FAQ database. If you desire so, the changes will be credited to your name. To learn more, visit our add content page.



All contents are copyright © 2007-2024 FirebirdFAQ.org unless otherwise stated in the text.


Links   Firebird   News   FlameRobin   Powered by FB: Home Inventory   Euchre  
Add content   About  

Categories
 Newbies
 SQL
 Installation and setup
 Backup and restore
 Performance
 Security
 Connectivity and API
 HOWTOs
 Errors and error codes
 Miscellaneous