Load data from DB2
This section explains how to connect DB2 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.
Download driver
Download the compatible JDBC driver from the IBM Support page.
Add JDBC driver
To add the JDBC driver, create a configuration file called settings.cfg
with the following settings:
Follow the procedure described in Add JDBC Driver to upload the settings.cfg
configuration and JDBC driver files to Exasol.
With some driver versions you may receive an error message indicating file permission issues. In this case you may have to disable the security manager by adding the line NOSECURITY=YES
to the settings.cfg file.
Run statement
Run the following statement to create a connection.
CREATE OR REPLACE CONNECTION JDBC_DB2
TO 'jdbc:db2://192.168.99.100:50000/sample'
USER 'db2inst1'
IDENTIFIED BY 'exasol123';
Run the following statement to test the connection.
select * from
(
import from JDBC at JDBC_DB2
statement 'select ''Connection works'' from SYSIBM.SYSDUMMY1'
);
Load data
You can use the IMPORT statement to load data using the connection you created above. IMPORT supports loading data from a table or a SQL statement.