Client application programming interfaces
Application programming interfaces provide various ways for clients to access a DB2® database server.
Java interfaces
DB2 provides two standards-based Java programming application programming interfaces (APIs) for writing portable application programs that access DB2:
- pureQuery®
- Developers can use pureQuery to build applications with less code than JDBC, but with greater control over database access than object-relational frameworks. Developers can use SQL for in-memory collections and databases without learning a new query language that is not optimal for data access.
- JDBC
- A generic interface for writing platform-independent applications that can access any SQL database.
- SQLJ
- Another SQL model that a consortium of major database vendors developed to complement JDBC. ISO (International Standards Organization) defines SQLJ. SQLJ is easier to code than JDBC and provides the superior performance, security, and maintainability of static SQL.
With DB2 for z/OS® support for JDBC, you can write dynamic SQL applications in Java. With SQLJ support, you can write static SQL applications in Java. These Java applications can access local DB2 data or remote relational data on any server that supports DRDA.
With DB2 for z/OS, you can use a stored procedure that is written in Java. (The DB2 Database family supports stored procedures that are written in many additional languages.) A stored procedure is a user-written application program that the server stores and executes. A single SQL CALL statement invokes a stored procedure. The stored procedure contains SQL statements, which execute locally at the server. The result can be a significant decrease in network transmissions.
You can develop Java stored procedures that contain either static SQL (by using SQLJ) or dynamic SQL (by using JDBC). You can define the Java stored procedures yourself, or you can use IBM® Data Studio and WebSphere® Studio Application Developer tools.
ODBC
DB2 Open Database Connectivity (ODBC) is the IBM callable SQL interface for relational database access. Functions are provided to application programs to process dynamic SQL statements. DB2 ODBC allows users to access SQL functions directly through a call interface. Through the interface, applications use procedure calls at execution time to connect to databases, to issue SQL statements, and to get returned data and status information. The programming languages that support ODBC are C and C++.
Web services
Web services are self-contained, modular applications that provide an interface between the provider and consumer of On-Demand business application resources over the Internet. Web services client applications can access a DB2 database.
DB2 Database Add-ins for Visual Studio
The IBM DB2 Database Add-ins for Microsoft Visual Studio is a set of tightly integrated application development and administration tools designed for DB2 Database. The Add-ins integrate into the Visual Studio .NET development environment so that application programmers can easily work within their Integrated Development Environment (IDE) to access DB2 data.
The following features offer key benefits:
- Support for client applications (both desktop and web-based applications) to use .NET to access remote DB2 servers
- A tool for building stored procedures that makes it easy for any application programmer to develop and test stored procedures with DB2 for z/OS without prior IBM Z skills or knowledge