Application Development Guide: Building and Running Applications

Application Development Guide: Building and Running Applications

IBM® DB2 Universal Database™ Application Development Guide: Building and Running Applications Ve r s i o n 8 SC09-4825-00 IBM® DB2 Universal Database™ Application Development Guide: Building and Running Applications Ve r s i o n 8 SC09-4825-00 Before using this information and the product it supports, be sure to read the general information under Notices. This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. You can order IBM publications online or through your local IBM representative. v To order publications online, go to the IBM Publications Center at www.ibm.com/shop/publications/order v To find your local IBM representative, go to the IBM Directory of Worldwide Contacts at www.ibm.com/planetwide To order DB2 publications from DB2 Marketing and Sales in the United States or Canada, call 1-800-IBM-4YOU (426-4968). When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1993 - 2002. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents About This Book ..........ix Setting Up the sample Database ....42 Creating the sample Database .....42 Part 1. The Application Creating the sample Database on Host or Development Environment ....1 AS/400 and iSeries Servers ......44 Cataloging the sample Database ....45 Binding the sample Database Utilities . 46 Chapter 1. DB2 Support ........3 Migrating Applications ........52 DB2 Application Development Client ....3 WheretoGoNext..........55 Database Manager Instances .......5 DB2 Supported Servers.........7 Chapter 3. Sample Programs and Related DB2 Supported Software for Building and Files ..............57 Running Applications .........8 Sample Files ............57 Supported Software by Platform .....9 Sample Programs: Structure and Design. 62 AIX Supported Software for Building and Sample Programs by Language and Running Applications ........9 Application Interface .........69 HP-UX Supported Software for Building C/C++ Samples..........69 and Running Applications ......11 DB2CLISamples.........72 Linux Supported Software for Building JDBCSamples..........74 and Running Applications ......12 SQLJ Samples ..........77 Solaris Supported Software for Building Java WebSphere Samples.......79 and Running Applications ......14 JavaPluginSamples........79 Windows Supported Software for Building COBOL Samples .........80 and Running Applications ......15 SQLProcedureSamples.......84 VisualBasicSamples........86 Chapter 2. Setup ..........19 VisualC++Samples........88 GeneralSetupInformation.......19 Windows Management Instrumentation Setting Up the Application Development Samples............88 Environment ...........19 Object Linking and Embedding (OLE) Updating the Database Manager Samples............89 ConfigurationFile.........21 Object Linking and Embedding Database Setting Up the Java Environment ....22 (OLE DB) Table Function Samples . 90 Setting Up the SQL Procedures Command Line Processor (CLP) Samples 90 Environment ...........23 REXX Samples ..........91 UNIX..............24 Log Management User Exit Samples . 93 Setting Up the UNIX Application Build Files, Makefiles, and Error-Checking Development Environment ......25 Utilities .............94 UNIX Environment Variable Settings. 26 Build Files ...........94 Java..............26 Makefiles ............97 SQLProcedures..........31 Error-Checking Utilities .......101 Windows .............34 Setting Up the Windows Application Development Environment ......35 Part 2. Building and Running Java..............38 Platform-Independent SQLProcedures..........40 Applications..........105 Sample Database ..........42 © Copyright IBM Corp. 1993 - 2002 iii Chapter 4. Java ..........107 Replacing an AIX Shared Library . 149 JavaSamplePrograms........107 Considerations for Installing COBOL on JavaAppletConsiderations......109 AIX.............149 JDBC..............111 IBMC.............150 Building JDBC Applets .......111 Building C Applications on AIX ....150 Building JDBC Applications .....112 Build Script for C Applications ....152 BuildingJDBCRoutines.......113 AIX C Application Compile and Link SQLJ ..............116 Options............153 Building SQLJ Programs ......116 BuildingCRoutinesonAIX.....154 Building SQLJ Applets .......117 Build Script for C Routines .....158 Building SQLJ Applications .....119 AIX C Routine Compile and Link Options 159 UNIX Build Script for SQLJ Applications Building C Multi-Threaded Applications and Applets...........120 onAIX............160 SQLJ Application Options for UNIX . 122 Build Script for C Multi-threaded Windows Batch File for SQLJ Applications ..........161 Applications and Applets ......122 VisualAgeC++...........161 SQLJ Application Options for Windows 124 Building C++ Applications on AIX . 161 Building SQLJ Routines .......125 Build Script for C++ Applications . 163 UNIX Build Script for SQLJ Routines . 126 AIX C++ Application Compile and Link SQLJ Stored Procedure Options for UNIX 128 Options............164 Windows Batch File for SQLJ Routines 129 BuildingC++RoutinesonAIX....165 SQLJ Stored Procedure Options for Build Script for C++ Routines.....169 Windows ...........131 AIX C++ Routine Compile and Link Options............170 Chapter 5. SQL Procedures ......133 Building C++ Multi-Threaded CreatingSQLProcedures.......133 Applications on AIX ........171 Calling SQL Procedures with Client Build Script for C++ Multi-threaded Applications on UNIX ........134 Applications ..........173 Calling SQL Procedures with Client VisualAge C++ Configuration Files ....173 Applications on Windows .......135 Building VisualAge C++ Programs with Retaining Intermediate Files for SQL Configuration Files ........173 Procedures............137 Building C++ DB2 API Applications with Customizing Precompile and Bind Options Configuration Files ........174 forSQLProcedures.........138 Building C++ Embedded SQL Backing Up and Restoring SQL Procedures 139 Applications with Configuration Files . 175 Distributing Compiled SQL Procedures . 140 Building C++ Stored Procedures with Rebinding SQL Procedures.......141 Configuration Files ........176 Building C++ User-defined Functions Chapter 6. Calling Stored Procedures . 143 with Configuration Files ......177 Calling Stored Procedures with the CALL IBM COBOL Set for AIX .......179 Statement............143 Configuring the IBM COBOL Compiler onAIX............179 Part 3. Building and Running Building IBM COBOL Applications on AIX.............180 Platform-Specific Applications . 145 Build Script for IBM COBOL Applications 181 AIX IBM COBOL Application Compile Chapter 7. AIX ..........147 andLinkOptions.........182 ImportantConsiderations.......148 Building IBM COBOL Routines on AIX 183 AIX Export Files for Routines .....148 Build Script for IBM COBOL Routines 184 AIX Routines and the CREATE Statement 148 iv Building and Running Applications AIX IBM COBOL Routine Compile and Building Micro Focus COBOL LinkOptions..........185 Applications on HP-UX .......222 Micro Focus COBOL .........186 Build Script for Micro Focus COBOL Configuring the Micro Focus COBOL Applications ..........224 Compiler on AIX .........186 HP-UX Micro Focus COBOL Application Building Micro Focus COBOL CompileandLinkOptions......225 Applications on AIX ........187 Building Micro Focus COBOL Routines Build Script for Micro Focus COBOL onHP-UX...........226 Applications ..........189 Build Script for Micro Focus COBOL AIX Micro Focus COBOL Application Routines............227 CompileandLinkOptions......190 HP-UX Micro Focus COBOL Routine Building Micro Focus COBOL Routines CompileandLinkOptions......228 onAIX............190 Build Script for Micro Focus COBOL Chapter 9. Linux..........231 Routines............192 LinuxC.............231 AIX Micro Focus COBOL Routine Building C Applications on Linux . 231 CompileandLinkOptions......193 Build Script for C Applications ....233 REXX ..............194 Linux C Application Compile and Link Building REXX Applications on AIX . 194 Options............234 BuildingCRoutinesonLinux.....235 Chapter 8. HP-UX .........197 Build Script for C Routines .....239 HP-UXC............197 Linux C Routine Compile and Link Building C Applications on HP-UX . 197 Options............240 Build Script for C Applications ....199 Building C Multi-Threaded Applications HP-UX C Application Compile and Link onLinux............241 Options............200 Build Script for C Multi-threaded BuildingCRoutinesonHP-UX....201 Applications ..........242 Build Script for C Routines .....205 LinuxC++............242 HP-UX C Routine Compile and Link Building C++ Applications on Linux . 242 Options............206 Build Script for C++ Applications . 244 Building C Multi-Threaded Applications Linux C++ Application Compile and Link onHP-UX...........207 Options............245 Build Script for C Multi-threaded BuildingC++RoutinesonLinux....246 Applications ..........208 Build Script for C++ Routines.....250 HP-UXC++............209 Linux C++ Routine Compile and Link Building C++ Applications on HP-UX . 209 Options............251 Build Script for C++ Applications . 211 Building C++ Multi-Threaded HP-UX C++ Application

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    379 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us