Supported programming languages for DB2 database systems
DB2 database systems support several programming languages for developing applications that can manage
or access databases including:
C/C++ - DB2 Call Level Interface (CLI) and ODBC
DB2® CLI is a dynamic SQL programming interface for creating C/C++ applications
that access DB2 databases. DB2 CLI is based on the X/Open Call Level Interface standard
and it is compatible with the Microsoft® Open Database Connectivity (ODBC) specification
for C applications. You can develop DB2 stored procedures and functions using DB2 CLI.
DB2 Call Level Interface (CLI) and ODBC
C/C++ - Embedded SQL
DB2 applications developed using the C/C++ programming languages can use embedded SQL techniques to create
applications using static and dynamic SQL statements. You can develop DB2 stored procedures and functions
using embedded SQL.
Embedded SQL statements in C and C++ applications
Java - Java Database Connectivity (JDBC)
JDBC provides a standard set of interfaces and classes for accessing databases from Java
applications using SQL. The JDBC driver provided with DB2 database systems is optimized
for the DB2 family of servers, is JDBC 3.0 compliant, and supports Type 4 and Type 2 modes.
You can develop DB2 stored procedures and functions using JDBC.
Java Database Connectivity (JDBC)
Java - Embedded SQL for Java (SQLJ)
SQLJ support for DB2 database application has been optimized for executing
embedded SQL statements within Java applications. Compared to using JDBC,
SQLJ reduces the amount of Java application code required. SQLJ and JDBC
modules can interoperate within the same Java
applications. You can develop DB2 stored procedures and functions using SQLJ.
Embedded SQL for Java (SQLJ)
Microsoft ADO.NET - Visual Basic .NET and C#
The IBM Data Server Provider for .NET is an ADO.NET interface to DB2 database systems.
By using the IBM Data Server Provider for .NET classes, your .NET applications will have
managed, secure, high-performance access to DB2 data.
You can develop DB2 stored procedures and functions using Microsoft CLR
(Common Language Runtime) compliant .NET languages.
IBM Data Server Provider for .NET
Perl
Perl is an open source scripting language. You can
create DB2 database applications using Perl using the DBD::DB2 driver with the Perl Database
Interface (DBI) Module, available from the
Perl DBI Web site.
Programming considerations for Perl
Building Perl applications
DB2 Perl Database Interface
PHP
PHP is an open source scripting language that is especially suited for Web development.
You can access your DB2 database system using the ibm_db2 PHP extension or the PHP Data Objects (PDO) driver.
To get started with PHP and DB2 you can also consider using
Zend Core for IBM. Zend Core for IBM is a
seamless, out-of-the-box, easy-to-install, and supported PHP development and production environment
optimized for DB2 database products.
Building PHP applications
PHP Web site downloads
Ruby on Rails
Ruby is quickly becoming a popular web development language due to the advent of Rails.
Ruby on Rails simplifies the development of web applications by automating the creation
and structure of common web application components.
Building Ruby applications
Starter Toolkit for DB2 on Rails
Related information
DB2 Supported Programming Interfaces
Setting up the application development environment
Application development with DB2 at developerWorks