Altova XMLSpy 2024 Enterprise Edition

This example illustrates how to connect to an IBM DB2 database through ODBC.

Prerequisites:

IBM Data Server Client must be installed and configured on your operating system (this example uses IBM Data Server Client 9.7). For installation instructions, check the documentation supplied with your IBM DB2 software. After installing the IBM Data Server Client, check if the ODBC drivers are available on your machine (see Viewing the Available ODBC Drivers).

Create a database alias. There are several ways to do this:

oFrom IBM DB2 Configuration Assistant

oFrom IBM DB2 Command Line Processor

oFrom the ODBC data source wizard (for this case, the instructions are shown below)

You have the following database connection details: host, database, port, username, and password.

To connect to IBM DB2:

1.Start the database connection wizard and select IBM DB2 (ODBC/JDBC).

2.Click Next.

DB2-02

3.Select ODBC, and click Next. If prompted to edit the list of known drivers for the database, select the database drivers applicable to IBM DB2 (see Prerequisites), and click Next.

DB2-02a

4.Select the IBM DB2 driver from the list, and then click Connect. (To edit the list of available drivers, click Edit Drivers, and then check or uncheck the IBM DB2 drivers you wish to add or remove, respectively.)

DB2-03

5.Enter a data source name (in this example, DB2DSN), and then click Add.

DB2-04

6.On the Data Source tab, enter the user name and password to the database.

DB2-05

7.On the TCP/IP tab, enter the database name, a name for the alias, the host name and the port number, and then click OK.

DB2-06

8.Enter again the username and password, and then click OK.

DB2-07

© 2017-2023 Altova GmbH