IBM Books

Road Map to DB2 Programming


Chapter 3. Using DB2 Features

DB2 comes with a variety of features that run on the server which you can use to supplement or extend your applications. When you use DB2 features, you do not have to write your own code to perform the same tasks.

DB2 also lets you store some parts of your code at the server instead of keeping all of it in your client application. This can have performance and maintenance benefits.

The following table lists some key DB2 features, and what they provide. There are features to protect data and to define relationships between data. And there are object-relational features to create flexible, advanced applications. You can use some features in more than one way, such as constraints, which enable you to protect data and to define relationships between data values.

Protect Data Define Relation- ships Object Relational
"Constraints" X X
"User-defined Types and Large Objects" X
X
"User-defined Functions"

X
"Triggers" X X
"Stored Procedures" X

To decide whether or not to use DB2 features, consider the following points:

Application independence
You can make your application independent of the data it processes. Using DB2 features that run at the database enables you to maintain and change the logic surrounding the data without affecting your application. If you need to make a change to that logic, you only need to change it in one place; at the server, and not in each application that accesses the data.

Performance
You can make your application perform more quickly by storing and running parts of your application on the server. This shifts some processing to generally more powerful server machines, and can reduce network traffic between your client application and the server.

Application requirements
Your application might have unique logic that other applications do not. For example, if your application processes data entry errors in a particular order that would be inappropriate for other applications, you might want to write your own code to handle this situation.

In some cases, you might decide to use DB2 features that run on the server because they can be used by several applications. In other cases, you might decide to keep logic in your application because it is used by your application only.

The following sections provide an overview of DB2 features, and point to detailed sources of information.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]