IBM Books

Application Building Guide


Questions

Question 1: How was the previous version application 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

HP-UX
/usr/bin/chatr executable

Silicon Graphics IRIX
/bin/elfdump -Lv executable

Solaris
/usr/bin/dump -Lv executable

where executable is the name of the application executable.

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 or 6 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.

For Version 1, the install path is /usr/lpp/db2_01_01_0000/lib. For Version 2, the install path is /usr/lpp/db2_02_01/lib. For Version 5, the install path is /usr/lpp/db2_05_00/lib. For Version 6, the install path is /usr/lpp/db2_06_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 Silicon Graphics IRIX and Solaris. 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 | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]