Learn how to connect to a DB2 database with Exasol and then load data.
To view details about data type mappings or to migrate data, see the DB2 to Exasol migration script in our GitHub repository.
The DB2 system must be reachable from the Exasol system.
The user credentials in the connection must be valid.
Download the compatible JDBC driver from the IBM Support page.
Do the following to configure the driver in EXAoperation:
DB2com.ibm.db2.jcc.DB2Driverjdbc:db2:To create a connection, run the following statement. Replace the connection string and credentials as needed.
CREATE OR REPLACE CONNECTION JDBC_DB2
TO 'jdbc:db2://192.168.99.100:50000/sample'
USER 'db2inst1'
IDENTIFIED BY 'exasol123';
To test the connection, run the following statement.
select * from
(
import from JDBC at JDBC_DB2
statement 'select ''Connection works'' from SYSIBM.SYSDUMMY1'
);
Use IMPORT to load data from a table or SQL statement using the connection that you created.