CBBrowne Computing

ODBC and Related Programming Interfaces

The ODBC API programming standard was developed and championed by Microsoft to provide a single programming API to all of the commercial SQL databases, as well as to head off a competing industry standard that Microsoft did not control. Microsoft won, and uses ODBC to promote other Microsoft database products at every turn.

Most Windows programmers use ODBC to connect to SQL databases. In actuality, ODBC is not too bad: it offers almost all of the basic features and functions that one might hope for in an SQL database API. Its only peculiarity and bizarrness is it's insistance on using "handles": a programming anachronism that Windows can't seem to shake. Despite this oddity, ODBC is a workable programming interface for Unix programmers, and is probably the best bet for anyone wishing to write code that can connnect to dozens of different databases. There's a good selection of alternatives, as seen below.

 

unixODBC 
unixODBC provides ODBC support for Gnu/Linux. C/C++. Dual license: GPL and LGPL, allows both free and commercial uses. Appears to include drivers for more than a dozen databases, including most major commercial and free databases. (UDB, DB2, Sybase, Informix, AdabasD, Postgres, MySQL, MiniSQL, Empress, YARD, Interbase, Linter, Mimer, among others.) Includes a graphical ODBC Driver Manager, and a graphical data explorer.

Commercial support via EasySoft.

iODBC 
iODBC is a LGPL'ed implementation of ODBC conforming to the Microsoft and X/Open SQL CLI (Call Level Interface) specifications. Language wrappers available for PHP and Perl, C++, Java, Python, TCL, others. Dozens of drivers available, mostly for commercial databases. Ported to dozens of different Unixes, including HP/UX, IRIX, MacOS classic, MacOS X, SCO, Sequent, Solaris, Unixware, AIX, FreeBSD, DG/UX and even OpenVMS.

This project appears to be an open-sourcing of the one of the ODBC products from OpenLink Software, which appears to continue to be actively involved in the maintenance of this project, and appears to offer commercial support for these interfaces. There's a fair amount of blurring between what's part of iODBC, and what's an OpenLink product, and the site encourages you to explore other OpenLink products.

 

ODBC++ 
ODBC++ provides a set of cross-platform C++ class libraries for ODBC access. Uses a thread-safe design, allows multi-threaded execution. LGPL.

 

FreeODBC++ 
FreeODBC++ provided LGPL'ed C++ ODBC interfaces for Gnu/Linux, FreeBSD and Windows. The C++ interfaces are based on/derived from the JDBC class hierarchy, and thus implements a good subset of JDBC in C++. On Unix, this is built on top of unixODBC, and thus offers the same driver selection.

 

sqlxx 
SQLxx provides some simple C++ iODBC wrappers for postgres and MySQL. LGPL.

 

FreeTDS 
FreeTDS implements the TDS (Tabular Data Stream) protocol that is used by Sybase and Windows clients to communicate with database servers. The native interface is C, and there are Perl and PHP wrappers for FreeTDS. There is also a FreeTDS driver for the JDBC 1 and 2 API's. The code is LGPL'ed, allowing commercial software to be developed on top of it. Uses a modern automake-based build system. Browsable CVS on sourceforge. This is a good choice if you know that all of your data will be on the Microsoft SQL Server.

 

OTL 
OTL provides a C++ STL stream iterator interface to ODBC, Oracle and DB2. STL is, of course, the Standard Template Library for C++. If you use STL, this is the thing for you.

 

DTL 
DTL makes ODBC recordsets look like an STL container. It provides standard STL iterators. Include C++ reflection (introspection??) support, thus automatically providing data-dictionary/dynamic runtime discovery.

 

OpenLink ODBC 
An ODBC client library is available from OpenLink Software. Provides Gnu/Linux support for Oracle, Sybase, Progress, Ingres and Informix with their client libraries.

linux users conflict resolution seminar