This file contains information on linking the Easysoft ODBC-ODBC
server with an ODBC driver or driver manager.

The Easysoft ODBC-ODBC Bridge server is distributed as one archive
file and four shared objects (this may differ slightly between
platforms depending on the extension for a shared object).

libserver.a
libdate.so
libsupport.so
libesrpc.so
libextra.so

The libserver.a archive contains the actual server and requires a
driver containing all the ODBC 3.0 API and some of the ODBC 2.0 API
(although if you are using ODBC 3.0, the ODBC functions may simply be
stubs as they will not be used). You may link the above
libraries/objects together with a driver manager rather than an ODBC
driver.

Assuming your ODBC driver is in libdriver.a (or libdriver.[s]o) in the
current working directory you would link the OOB server with the
driver like this:

cc -o esoobserver -L. -L<install_path>/easysoft/lib \
                  -L<install_path>/easysoft/oob/server \
                  libserver.a -ldate -lsupport -lesrpc -lextra -ldriver

If the driver is an ODBC 3.0 driver then you may have to provide stubs
for some ODBC 3.0 functions such as (SQLAllocEnv, SQLAllocConnect and
SQLAllocStmt) - see below.

The resultant executable (esoobserver) should be copied to the
oob/server subdirectory of the OOB installation directory. Here, there
is a small script ("server") which will be run by the inetd daemon
when an OOB client connects to the OOB server's port.

Using an ODBC 3.n driver with the OOB Server and without a Driver Manager
-------------------------------------------------------------------------

The OOB server is designed to work with or without a Driver Manager.
However, if you use the OOB server with an ODBC 3.n driver and choose
not to use a driver manager then you may need to add some stub
functions to your build for the ODBC 3.0 functions the OOB server
references.

Assuming you have just attempted to link the OOB Server with an ODBC
3.n driver you will probably get undefiend symbols for SQLAllocEnv,
SQLAllocConnect and SQLAllocStmt (or a combination thereof). The OOB
server will not actually use these functions when using ODBC 3.0 so it
is safe to add stub functions that do nothing at all except keep the
linker happy.

These functions should look like this:

SQLRETURN  SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle)
{
    return SQL_ERROR;
}

SQLRETURN  SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle,
           SQLHDBC *ConnectionHandle)
{
    return SQL_ERROR;
}

SQLRETURN  SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle,
           SQLHSTMT *StatementHandle)
{
    return SQL_ERROR;
}

You will probably have to add a #include from your driver to get the
definitions for SQLRETURN, SQL_ERROR etc (or alternatively use the
odbc.h header file that comes with the OOB client). You should then
compile this C source file and add it to the link line above.

