Choosing programming languages and methods to use

You can use a wide variety of programming languages and techniques to develop application programs for DB2 UDB for z/OS. You can choose among the following programming languages:

  • Java

  • C

  • C++

  • COBOL

  • Smalltalk

  • REXX

  • Fortran

  • PL/I

  • High-level Assembler (part of the z/OS operating system)

Several methods are available for communicating with DB2. You can use any of the following programming methods:

Static SQL

The source form of a static SQL statement is embedded within an application program that is written in a traditional programming language. (Traditional programming languages include C, C++, COBOL, Fortran, PL/I, and Assembler.) Static SQL is a good choice when you know what statements an application needs to execute before the application runs. You can read more about this programming method in “Writing static SQL applications” on page 185.

Dynamic SQL

Unlike static SQL, dynamic statements are constructed and prepared at run time. Dynamic SQL is a good choice when you do not know the format of an SQL statement when you write a program. It is also a good choice when the program needs to generate part or all of an SQL statement according to input from its users. You can read more about this programming method in “Writing dynamic SQL applications” on page 194.

ODBC

ODBC is an application programming interface (API) that C and C++ application programs can use to access relational databases. ODBC is well suited to the client/server environment. You can read more about this programming method in “Using ODBC to execute dynamic SQL” on page 196.

SQLJ and JDBC

Like ODBC and C++, the SQLJ and JDBC Java interfaces let you write portable application programs that are independent of any one database product.

  • SQLJ application support lets you write static SQL applications in the Java programming language. With SQLJ, you can embed SQL statements in your Java applications.

  • JDBC application support lets you write dynamic SQL applications in the Java programming language. JDBC is similar to ODBC, but it is designed specifically for use with Java.

You can read more about these programming methods in “Using Java to execute static and dynamic SQL” on page 198.

You can read about how you can use stored procedures for client/server applications in “Using an application program as a stored procedure” on page 202.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.97.40