Before you start
In this tutorial, you'll learn about writing Java code that interfaces with DB2 Universal Database. You'll see how to:
- Connect to a DB2 database from a Java application
- Use JDBC to read and update data in a DB2 database
- Use SQLJ to read and update data in a DB2 database
- Troubleshoot a DB2 Java application
This tutorial provides you with the fundamental skills required to develop Java applications for DB2.
This is the fifth in a series of seven tutorials that you can use to help prepare for the DB2 UDB V8.1 Family Application Development Certification exam (Exam 703). The material in this tutorial primarily covers the objectives in Section 5 of the exam, entitled "Java programming." You can view these objectives at: http://www.ibm.com/certify/tests/obj703.shtml.
You do not need a copy of DB2 Universal Database to complete this tutorial. However, you can download a free trial version of IBM DB2 Universal Database from the developerWorks downloads site for reference.
Who should take this tutorial?
To take the DB2 UDB V8.1 Family Application Development exam, you must have already passed the DB2 UDB V8.1 Family Fundamentals exam (Exam 700). You can use the DB2 Family Fundamentals tutorial series (see Resources) to prepare for that test. It is a very popular tutorial series that has helped many people understand the fundamentals of the DB2 family of products.
This tutorial is one of the tools that can help you prepare for Exam 703. You should also review Resources at the end of this tutorial for more information.
In addition to this DB2 background, you should also have basic knowledge of SQL and the Java platform before taking this tutorial.
If you plan to develop Java applications for DB2, or you plan to try out this tutorial's sample code yourself, you need to complete the following tasks:
- Install DB2 Universal Database, Version 8.1 for Linux, UNIX, or Windows.
- Create the sample database by running
db2samplfrom the DB2 CLP. The sample code in this article has been written to work with this database. - Install the Java Runtime Environment, Java 2 Technology Edition, Version 1.3.1.
- Update the
PATHenvironment variable to include thejdk\bindirectory of the Java SDK you have installed. Note that DB2 includes Java SDK, version 1.3.1, in the$DB2PATH\sqllib\java\jdk\bindirectory ($DB2PATH/sqllib/java/jdk/binin UNIX).
Copyright, 2004 International Business Machines Corporation. All rights reserved.
IBM, DB2, DB2 Universal Database, DB2 Information Integrator, WebSphere and WebSphere MQ are trademarks or registered trademarks of IBM Corporation in the United States, other countries, or both.
Other company, product, and service names may be trademarks or service marks of others.




