A

Appendix A. Sample applications

This appendix provides the application codes of various languages used in demonstrating the DB2 application deployment as well as deploying pre-configured database.

A.1 C/C++

Example A-1shows the application used to demonstrate the deployment of the DB2 C/C++ application.

Example: A-1 Sample CLI application

/****************************************************************************

**

**A sample CLI application which makes DSN-less connection to database.

**Database connectivity informations are read from command line arguments.

*****************************************************************************

**Build the application:

**

**There are two approaches to build this applicaiton:

**1. use bldapp script that is included in DB2 installation

**2. use recommended compile and link options according to DB2 information center:

© Copyright IBM Corp. 2008. All rights reserved.

259

Page 273
Image 273
IBM DB2 manual C/C++, 259, Example A-1 Sample CLI application