DB2 10.5 for Linux, UNIX, and Windows

How JDBC applications connect to a data source

Before you can execute SQL statements in any SQL program, you must be connected to a data source.

The IBM® Data Server Driver for JDBC and SQLJ supports type 2 and type 4 connectivity. Connections to DB2® databases can use type 2 or type 4 connectivity. Connections to IBM Informix® databases can use type 4 connectivity.

The following figure shows how a Java™ application connects to a data source using IBM Data Server Driver for JDBC and SQLJ type 2 connectivity.

Figure 1. Java application flow for IBM Data Server Driver for JDBC and SQLJ type 2 connectivity
Java application flow for a type 2 driver

The following figure shows how a Java application connects to a data source using IBM Data Server Driver for JDBC and SQLJ type 4 connectivity.

Figure 2. Java application flow for IBM Data Server Driver for JDBC and SQLJ type 4 connectivity
Java application flow for a type 4 driver