Neoview ODBC Drivers Manual (R2.2 SP1)

Table Of Contents
Setting Up the Client Environment
If you selected default options during installation, ensure that:
The include (*.h) files are in the /usr/include/hpodbc directory.
An MXODSN file is in the /etc/hpodbcdirectory, if you are using libhpodbc.
NOTE: By default, the MXODSN file in the package will be installed as
/etc/hpodbc/MXODSN.template. Rename it to MXODSN, and make necessary changes
to the file before using the drivers.
The drivers expect the MXODSN file to be present in either the default location (/etc/hpodbc)
or the current working directory (CWD) of the application.
or
The third party driver manager is properly configured, if you are using libhpodbc_drvr.
The library is located in the /usr/lib directory.
If you selected non default locations during installation, ensure that the files are installed in the
directories that you specified in Steps 6 to 9 in “Installing or Reinstalling HP Neoview ODBC
Drivers for Linux, HP-UX, IBM AIX®, and Sun Solaris”.
Running the Sample Program
This sample assumes you are using the library that includes both the driver and driver manager.
The examples after each step assume that you have default installation directories.
1. Move to the directory where you installed the sample program:
cd /etc/hpodbc/sample
2. Compile the sample program:
NOTE: All drivers, other than the driver for HP-UX(IA-64) 64–bit and the x86–64 Linux
driver, are 32–bit drivers. Therefore, applications must be compiled accordingly.
On Linux:
gcc connect_test.cpp -L/usr/lib -I/usr/include/hpodbc \
-lhpodbc -o connect_test
NOTE: The Linux driver is a 32–bit driver. If you are using an x86–64 machine, you
need to explicitly compile your application as a 32–bit application. For example:
gcc connect_test.cpp -m32 -L/usr/lib -I/usr/include/hpodbc \
-lhpodbc -o connect_test
On x86–64 Linux:
gcc connect_test.cpp -L/usr/lib -I/usr/include/hpodbc \
-lhpodbc -o connect_test
On HP-UX(IA-64):
aCC -AA connect_test.cpp -L/usr/lib -I/usr/include/hpodbc \
-lhpodbc -o connect_test -lm
To use cc for compiling and linking:
1. Rename connect_test.cpp to connect_test.c
2. cc connect_test.c -I/usr/include/hpodbc -L/usr/lib \
-lstd_v2 -lCsup -lunwind -lm -lhpodbc -o connect_test
On HP-UX(IA-64) 64–bit:
Setting Up the Client Environment 39