Applications written in the C/C++ programming language can access and manipulate data in a DB2 database using embedded SQL or through the DB2 Call Level Interface (CLI).
Embedded SQL statements in an application can either be of static or dynamic type. If the complete SQL statement and all database objects accessed within the statement are known prior to compile time, then it can be written as a static SQL statement. Otherwise, if the complete SQL statement or any database objects accessed within the statement are not known until runtime, then it must be written as a dynamic SQL statement. Using embedded SQL in an application requires a precompiler to create its associated package in the database. A package is a database object and is needed for processing because it holds the optimized form of an SQL statement.
The DB2 Call Level Interface is an SQL interface that C/C++ applications can use to interact with DB2. The interface follows the ISO CLI and Microsoft's Open Database Connectivity (ODBC) standard. In addition, it provides some useful DB2 Application Programming Interfaces (APIs). Writing C/C++ code to make use of the CLI interface is an alternative to using embedded dynamic SQL.
Whether a C/C++ application uses embedded static SQL, embedded dynamic SQL, or the CLI interface is dependent on several factors. If database statistics do not change much, programs can run faster using embedded static SQL because source files are precompiled and SQL statements do not need to be prepared at runtime. However, if database statistics change often, programs can run faster using embedded dynamic SQL because it uses current database statistics during runtime. If the application wants to make use of dynamic SQL processing, or the application will run against different database products, then using the CLI interface to access DB2 can be the best approach. This is because you do not need to precompile CLI applications, and, hence, there are no application bind files that need to be bound to the database. Note that it is possible for an application to use both embedded static SQL and the CLI interface (which runs dynamic SQL) by writing a CLI application with static SQL modules. You need to take all these factors into consideration when coding a C/C++ application to interact with DB2.
C/C++ development environment setup
Developing C/C++ applications with the DB2 product family requires the DB2 Application Development Client (which is part of the DB2 Client in V9) and a supported C/C++ compiler.
DB2 Express-C is currently supported on Linux and Windows platforms. At the time of writing, the following C/C++ compilers are supported.
Supported C/C++ Compiler versions
Setting up the C/C++ environment
To set up the C/C++ environment, follow these steps:
IBM DB2 Related Interview Questions
|IBM Websphere Interview Questions||IBM-REXX Interview Questions|
|IBM Cognos Interview Questions||IBM DB2 Interview Questions|
|J2EE Interview Questions||COBOL Interview Questions|
|IBM-JCL Interview Questions||DB2 Using SQL Interview Questions|
|IBM WAS Administration Interview Questions||IBM WebSphere Administration Interview Questions|
|Database Administration Interview Questions||DB2 SQL Programming Interview Questions|
|Mainframe DB2 Interview Questions|
IBM DB2 Related Practice Tests
|IBM Websphere Practice Tests||IBM Cognos Practice Tests|
|IBM DB2 Practice Tests||J2EE Practice Tests|
|COBOL Practice Tests||IBM-JCL Practice Tests|
|DB2 Using SQL Practice Tests||IBM WAS Administration Practice Tests|
|Database Administration Practice Tests||DB2 SQL Programming Practice Tests|
Ibm Db2 Tutorial
Db2 Application Development Overview
Application Development With Db2 Purexml
Application Development With Php
Application Development With C/c++
Application Development With Java
Application Development With .net
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.