Application Building Guide


Questions

Question 1: How was the application on the previous DB2 version linked to the DB2 client run-time library, for example, libdb2.a on AIX?

To determine the embedded shared library search path for an executable, use one of the following system commands:

AIX
/usr/bin/dump -H executable_filename

HP-UX
/usr/bin/chatr executable_filename

Linux
/usr/bin/objdump -p executable_filename

PTX
/usr/bin/dump -Lv executable_filename

Silicon Graphics IRIX
/bin/elfdump -Lv executable_filename

Solaris
/usr/bin/dump -Lv executable_filename

where executable_filename is the name of the executable file for the application.

The following is a sample dump listing from a DB2 Version 1 for AIX application:

   --------------------------------------------------------------------------
 
     dbcat:
 
       ***Loader Section***
                           Loader Header Information
     VERSION#         #SYMtableENT     #RELOCent        LENidSTR
     0x00000001       0x00000012       0x00000029       0x00000064
 
     #IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
     0x00000004       0x000003bc       0x00000077       0x00000420
 
 
       ***Import File Strings***
     INDEX  PATH                          BASE                MEMBER
     0      /usr/lpp/db2_01_01_0000/lib:/usr/lpp/xlC/lib:/usr/lib:/lib
 
 
 
     1                                    libc.a              shr.o
     2                                    libC.a              shr.o
     3                                    libdb2.a            shr.o
 
 
   --------------------------------------------------------------------------

Line 0 (zero) shows the directory paths that the executable searches to find the shared libraries to which it is linked. Lines 1, 2, and 3 show the shared libraries to which the application is linked.

Depending on how the application was built, you may see the following paths: /usr/lpp/db2_01_01_0000/lib, INSTHOME/sqllib/lib (where INSTHOME is the home directory of the database instance owner), or just the /usr/lib:/lib combination.

Question 2: How are the DB2 run-time libraries configured on your system?

When either of DB2 Versions 1, 2, 5, 6.1 or 7.1 is installed, there is an optional step which creates symbolic links from the system default shared library path /usr/lib to the DB2 install path which contains the DB2 client run-time libraries.

The install paths for the different DB2 versions are as follows:

Version 1
/usr/lpp/db2_01_01_0000/lib

Version 2
/usr/lpp/db2_02_01/lib

Version 5
/usr/lpp/db2_05_00/lib

Version 6.1
/usr/lpp/db2_06_01/lib

Version 7.1
/usr/lpp/db2_07_01/lib

In all cases, the run-time shared libraries are named libdb2.a.

Only one version of these libraries can be the default at any one time. DB2 provides this default so that when you build an application, it does not depend on a particular version of DB2.

Question 3: Do you specify different search paths in your environment?

You can override the shared library search path coded in your application using the LIBPATH environment variable on AIX, SHLIB_PATH on HP-UX, and LD_LIBRARY_PATH on Linux, PTX, Silicon Graphics IRIX and Solaris.
Note:For n32 object type applications on Silicon Graphics IRIX, use the LD_LIBRARYN32_PATH environment variable.
You can see the library search path using the appropriate system command for your platform given in the answer to Question 1.


[ Top of Page | Previous Page | Next Page ]