Example 4-10 A failed connect test using itso_cliapp

db2inst1@mensa:~/work> ./itso_cliapp mensa 50000 itso db2inst1 wrongassword

Connecting to the database itso ...

Failed to connect to the database itso.

SQLSTATE = 08001

SQLCODE = -30082

Message: [IBM][CLI Driver] SQL30082N Security processing failed with reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001

Preparing the deployment package

Once the redistributable driver files and the application executable file are ready, you can package them together for deploying. We have built a redistributable package itso_cli.tar.gz and a sample application called itso_cliapp. Now we put them into a single package and deploy the package using a script:

1.Under the DB2 development environment, create a working folder

install_image. Create two subdirectories under install_image, named bin and odbcdrv.

mkdir -p ~/install_image/bin ~/install_image/odbcdrv

2.Copy the sample application and ODBC CLI driver into the subdirectories respectively. So we copy itso_cliapp to bin, and itso_cli.tar.gz to odbcdrv.

3.Create a deployment script app_install under directory app_install. The entire directory should look as shown in Example 4-11.

Example 4-11 The complete contents of install_image

db2app@mensa:~/install_image> ls -Rl

.: total 4

-rwxr--r-- 1 db2app appgrp 2771 2008-06-20 17:40 app_install

drwxr-xr-x

2

db2app

appgrp

72 2008-06-20

16:20

bin

drwxr-xr-x

2

db2app

appgrp

80 2008-06-20

16:20

odbcdrv

./bin: total 12

-rwxr-xr-x 1 db2app appgrp 11801 2008-06-20 16:20 itso_cliapp

./odbcdrv: total 9345

-rw-r--r-- 1 db2app appgrp 9557108 2008-06-20 16:20 odbc_cli.tar.gz

164DB2 Deployment Guide

Page 178
Image 178
IBM DB2 manual Preparing the deployment package, Example 4-10 a failed connect test using itsocliapp