DB2 Application Development Environment

Team-Fly    

 
DB2 Universal Database for OS/390 v7.1 Application Certification Guide
By Susan Lawson
Table of Contents
Chapter 5.  Using SQL in an Application Program


Suppose you are writing an application program to access data in a DB2 database. When your program executes a SQL statement, the program needs to communicate with DB2. When DB2 finishes processing an SQL statement, DB2 sends back a return code, and your program should test the return code to examine the results of the operation.

To communicate with DB2, you need to choose one of these methods :

  • Static SQL

  • Dynamic SQL

  • Open database connectivity (ODBC)

  • JDBC application support

ODBC lets you access data through ODBC function calls in your application. You execute SQL statements by passing them to DB2 through an ODBC function call. ODBC eliminates the need for precompiling and binding your application and increases the portability of your application by using the industry-standard ODBC interface, but the ODBC processor does issue dynamic SQL.

If you are writing your applications in Java, you can use the industry-standard JDBC application support to access DB2. JDBC is similar to ODBC but is designed specifically for use with Java and is therefore a better choice than ODBC for making DB2 calls from Java applications.


Team-Fly    
Top


DB2 Universal Database for OS. 390 v7. 1 Application Certification Guide
DB2(R) Universal Database for OS/390 V7.1 Application Certification Guide (IBM DB2 Certification Guide Series)
ISBN: 0131007718
EAN: 2147483647
Year: 2002
Pages: 163
Authors: Susan Lawson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net