unixODBC

PROGRAMMER MANUAL
Peter Harvey
19.DEC.01

Introduction

Welcome to the unixODBC Programmer Manual. This manual is a starting point for a programmer who is interested in developing an application which *uses* ODBC. This manual does not address Driver development or any other development which is internal to the ODBC sub-system.

Why Use ODBC?

ODBC provides a portable Application Programmers Interface (API) with which to access data. This means that your data access code will recompile without changes on all popular platforms. In practice; portability is sometimes hampered by incomplete drivers. However; the core ODBC functionality (the most used functionality) is always supported any working driver. Other advantages to developing with ODBC include;

- most popular API of its kind
- most mature API of its kind
- skills more reusable/easily found
- hundreds, if not thousands, of applications use it
- availible on all majour platforms
- easy to change data storage solution/vendor (ah; freedom)
- easy to upscale data storage (developer and end-user)
- arguably the most complete API of its kind
- many books on the subject
- greater support base

Languages Supported

ODBC is based upon a C API. C++ programmers will find a number of C++ class libraries for using the ODBC API. These are wrappers - using the C API internally but can provide a much nicer way to use ODBC for C++ programmers.

Any language which can call a C API should be able to use the ODBC API and most languages, such as PHP and Perl, provide an interface to work with ODBC but these are not covered in this manual.

Architecture

Client Libraries

These are client libraries which are specific to the particular database being used. These, often, provide a C API of their own which is used by Driver developers. In some cases these exist inside of the Driver itself or are staticly linked into the Driver. Any Client Libraries required by a Driver will be a part of the installation of your Driver or will simply be a requirement for the installation of your Driver. Sometimes Client Libraries must be configured before any ODBC configuration.

Driver

Driver Manager

The Driver Manager acts as a gateway to the ODBC drivers. The main advantage to having a Driver Manager is that the end-user can configure the Driver Manager to use a different Driver than the one original conceived of by the programmer.

It as virtualy identical functions declarations as a Driver which means that one *could* create an application