Linking ODBC applications on Unix

An ODBC driver manager is included with SQL Anywhere and there are third party driver managers available. This section describes how to build ODBC applications that do not use an ODBC driver manager.

ODBC driver

The ODBC driver is a shared object or shared library. Separate versions of the SQL Anywhere ODBC driver are supplied for single-threaded and multi-threaded applications. A generic SQL Anywhere ODBC driver is supplied that will detect the threading model in use and direct calls to the appropriate single-threaded or multi-threaded library.

The ODBC drivers are the following files:

Operating system Threading model ODBC driver
(all Unix except Mac OS X and HP-UX) Generic libdbodbc11.so (libdbodbc11.so.1)
(all Unix except Mac OS X and HP-UX) Single threaded libdbodbc11_n.so (libdbodbc11_n.so.1)
(all Unix except Mac OS X and HP-UX) Multi-threaded libdbodbc11_r.so (libdbodbc11_r.so.1)
HP-UX Generic libdbodbc11.sl (libdbodbc11.sl.1)
HP-UX Single threaded libdbodbc11_n.sl (libdbodbc11_n.sl.1)
HP-UX Multi-threaded libdbodbc11_r.sl (libdbodbc11_r.sl.1)
Mac OS X Generic libdbodbc11.dylib
Mac OS X Single threaded libdbodbc11_n.dylib
Mac OS X Multi-threaded libdbodbc11_r.dylib

The libraries are installed as symbolic links to the shared library with a version number (shown in parentheses).

In addition, the following bundles are also provided for Mac OS X:

Operating system Threading model ODBC driver
Mac OS X Single threaded dbodbc11.bundle
Mac OS X Multi-threaded dbodbc11_r.bundle

To link an ODBC application (Unix)

  1. Link your application against the generic ODBC driver libdbodbc11.

  2. When deploying your application, ensure that the appropriate (or all) ODBC driver versions (non-threaded or threaded) are available in the user's library path.

Data source information

If SQL Anywhere does not detect the presence of an ODBC driver manager, it uses the system information file for data source information. See Using ODBC data sources on Unix.