# IBM DB2

The IMB DB2 Database integration will connect trough ODBC. Therefore you need to have the ODBC driver installed on the machine where the WriteBackExtreme application is also located. &#x20;

Download the drivers for your system at <https://www.ibm.com/docs/en/db2-warehouse?topic=db2-downloading-clients-drivers>

The downloaded package contains a readme file that describes the instructions for your platform.&#x20;

## Windows

Use the following commands to setup the driver and ODBC configuration

```
./db2cli.exe install -setup
./db2cli.exe writecfg add -database [database] -host [host] -port 50000
./db2cli.exe writecfg add -dsn [dsn_name] -database [database] -host [host] -port 50000
./db2cli.exe registerdsn -add -dsn [dsn_name]
```

Replace the \[host], \[database] and \[dsn\_name] to your situation.&#x20;

\
Validate the ODBC using this command:

```bash
./db2cli.exe validate -dsn [dsn_name] -connect -user [username] -passwd "[password]"
```

## Linux

Once the driver is installed under /opt/ibm/dsdriver, the next step is to configure ODBC by updating the /etc/odbc.ini file.&#x20;

```
[IBMDB2]
Driver=/etc/ibm/dsdriver/lib/libdb2o.so
```

The final thing to configure is setting the DB2INSTANCE environment variable on the service so that the driver knows what instance to connect to.&#x20;

**Open /etc/sysconfig/WriteBackExtreme**

Add this line:

```
DB2INSTANCE=[your_db_istance]
```

Replace \[your\_db\_istance] with your db instance.&#x20;

Reboot the WriteBackExtreme service afterwards.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infotopics.com/writebackextreme/features/database-connections/ibm-db2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
