Connect to IBM DB2 using the Database connector in Jitterbit Integration Studio
This page details how to connect to IBM DB2 using the Database connector. There are instructions for installing the JTOpen (AS400) and the JCC JDBC drivers.
Note
A few customers have experienced issues connecting to DB2 on iSeries using the JDBC driver. In these cases, the issues were resolved by using the ODBC driver (private agents only).
IBM DB2 (AS400)
You can connect to DB2 on iSeries using either a JDBC or ODBC driver. Note that if you want to use additional features, such as being able to provide a manual query, these are available using the JDBC driver only. These instructions are for installing the JTOpen (AS400) JDBC driver.
Install the JDBC driver
-
Download JTOpen. The ZIP file includes the JDBC driver file
jt400.jar
. -
Install the driver on a private agent by unzipping the download and then copying the
jt400.jar
file to<JITTERBIT_HOME>/tomcat/drivers/lib/
, replacing<JITTERBIT_HOME>
with the path to your private agent root directory. -
Edit the file
<JITTERBIT_HOME>/JdbcDrivers.conf
and add this driver entry:<Driver> <Name>IBM DB2</Name> <Class>com.ibm.as400.access.AS400JDBCDriver</Class> <Subprotocol>as400</Subprotocol> </Driver>
-
All Jitterbit services must be restarted in order for the new configuration to take effect.
On the machine where each private agent is installed, first stop the services, then restart them. See Restart a Windows private agent or Restart a Linux private agent for more information.
Configure the Database connection
After the JDBC driver is installed, specify these inputs during configuration of the Database connection:
-
Driver Type: Select JDBC.
-
Driver: Select the IBM DB2 (AS400) driver.
-
Use Connection String: Under Optional Settings, select this checkbox.
-
Connection String: Under Optional Settings, enter a manual connection string, replacing this example with your own host, libraries, and database name (if applicable):
Sample Connection Stringjdbc:as400://example.com;libraries=LIB1;Database=S12345;socket timeout=30000
WHERE clause examples
These WHERE clause examples are provided for reference purposes when configuring a Database query activity:
WHERE WORKDEPT = 'D21' AND HIREDATE > '1987-12-31'
WHERE WORKDEPT = 'C01' OR WORKDEPT = 'D11'
WHERE WORKDEPT = 'E11' AND NOT JOB = 'ANALYST'
WHERE EDLEVEL > 12 AND
(WORKDEPT = 'E11' OR WORKDEPT = 'E21')
WHERE WORKDEPT = 'E11' AND EDLEVEL = 12 AND JOB = 'CLERK'
WHERE (WORKDEPT, EDLEVEL, JOB) = ('E11', 12, 'CLERK')
For additional examples, refer to the IBM Knowledge Center articles for the specific version:
- Specifying a search condition using the WHERE clause
- Multiple search conditions within a WHERE clause
- Defining complex search conditions
IBM DB2 (JCC)
You can connect to DB2 on iSeries using either a JDBC or ODBC driver. Note that if you want to use additional features, such as being able to provide a manual query, these are available using the JDBC driver only. These instructions are for installing the JCC JDBC driver.
Important
IBM's JCC driver requires a license file db2jcc_license_cisuz-XX.jar
. If you do not have a license file, you will need to obtain one or use the JTOpen (as400) library instead.
Install the JDBC driver
-
Download JCC from IBM's DB2 JDBC Driver Versions and Downloads. The TAR.GZ file includes a ZIP file with the JDBC driver file
db2jcc4.jar
.Note
The driver file
db2jcc.jar
uses the JDBC 3 specification and is deprecated. Use the driver filedb2jcc4.jar
, which uses the JDBC 4 specification instead. -
Install the driver on a private agent by extracting the download and then copying the file
db2jcc4.jar
to<JITTERBIT_HOME>/tomcat/drivers/lib/
, replacing<JITTERBIT_HOME>
with the path to your private agent root directory. -
Edit the file
<JITTERBIT_HOME>/JdbcDrivers.conf
and add this driver entry:<Driver> <Name>IBM DB2 JCC Driver</Name> <Class>com.ibm.db2.jcc.DB2Driver</Class> <Subprotocol>db2</Subprotocol> </Driver>
-
Locate and copy your IBM-provided license file
db2jcc_license_cisuz-XX.jar
to<JITTERBIT_HOME>/tomcat/shared/lib/
. -
Edit the file
<JITTERBIT_HOME>/tomcat/conf/catalina.properties
and add this entry if not present:shared.loader=${catalina.home}/shared/lib/*.jar
-
All Jitterbit services must be restarted in order for the new configuration to take effect.
On the machine where each private agent is installed, first stop the services, then restart them. See Restart a Windows private agent or Restart a Linux private agent for more information.
Configure the Database connection
After the JDBC driver is installed, specify these inputs during configuration of the Database connection:
-
Driver Type: Select JDBC.
-
Driver: Select the IBM DB2 (JCC) driver.
-
Use Connection String: Under Optional Settings, select this checkbox.
-
Connection String: Under Optional Settings, enter a manual connection string, replacing this example with your own host and database name (if applicable):
Sample Connection Stringjdbc:db2://example.com/DBNAME
WHERE clause examples
These WHERE clause examples are provided for reference purposes when configuring a Database query activity:
WHERE WORKDEPT = 'D21' AND HIREDATE > '1987-12-31'
WHERE WORKDEPT = 'C01' OR WORKDEPT = 'D11'
WHERE WORKDEPT = 'E11' AND NOT JOB = 'ANALYST'
WHERE EDLEVEL > 12 AND
(WORKDEPT = 'E11' OR WORKDEPT = 'E21')
WHERE WORKDEPT = 'E11' AND EDLEVEL = 12 AND JOB = 'CLERK'
WHERE (WORKDEPT, EDLEVEL, JOB) = ('E11', 12, 'CLERK')
For additional examples, refer to the IBM Knowledge Center articles for the specific version: