Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 4. Connect IBM i5/OS with JDBC > Preparing to use JDBC - Pg. 52

4.1 Introduction to JDBC The JDBC application programming interface (API) was designed to make coding common Structured Query Language (SQL) statements in Java simple and easy. At the same time, more complex SQL statements are possible. The typical steps to use the JDBC API are: 1. 2. 3. 4. Load the JDBC driver. Create the JDBC connection. Create and execute your SQL statements. Close the JDBC connection. The JDBC API is part of the standard Java Development Kit (JDKTM). Version 1.0 of JDBC runs on JDK 1.1.x and later. Version 2.0 of JDBC runs on JDK 1.2 and later. 4.2 Preparing to use JDBC As you can see in 4.1, "Introduction to JDBC" on page 52, the first step in using JDBC is to load the JDBC driver. This leads to the question of which driver to use and where to get it. For DB2 Universal Database (UDB) for iSeries there are two different JDBC drivers that can be used. They are commonly known as the native driver and the toolbox driver. The native driver is shipped as part of licensed program Java Developer Kit 5722JV1. The toolbox driver is part of licensed program IBM Toolbox for Java 5722JC1. A simple comparison of the two drivers is that the native driver is faster but runs only on the IBM i5/OS Java virtual machine (JVMTM), while the toolbox driver runs on any JVM. A good discussion about these drivers can be found at: