How to query IBM Data Virtualization Manager (DVM) data source using Federation Server through JDBC driver

Created by Hai Jun Shen on Tue, 12/10/2019 - 01:56
Published URL:
https://www.ibm.com/support/pages/node/1127601
1127601

Question & Answer


Question

How to query IBM Data Virtualization Manager (DVM) data source using Federation Server through JDBC driver?

Cause

Customers want to use Federation server connect to DVM through JDBC driver.

Answer

To configure a federation to access DVM data source through federation JDBC wrapper, you must provide the information about the data source and objects that you want to access. Then create wrapper, server, user mapping and nickname about the tables on remote DVM data source.

Procedure

1. Enable Federation server and restart Db2.

# db2 update dbm cfg using federated YES

# db2stop force

# db2start

2. Test the connection to the DVM data source and verify the service is started correctly.

telnet <dvm_ip> <port>
If the connection is successful, you receive the following similar output from the command.

# telnet 137.134.252.107 15082
Trying 137.134.252.107...
Connected to 137.134.252.107.

If the connection fails, you will receive an error, please check the DVM service status.

3. Create wrapper, server, user mapping, nickname, and query the nickname. 

# connect to testdb

# CREATE WRAPPER "JDBC" LIBRARY 'libdb2rcjdbc.so' OPTIONS (DB2_FENCED 'Y' )

# CREATE SERVER server1 TYPE JDBC WRAPPER "JDBC" OPTIONS (DRIVER_CLASS  'com.rs.jdbc.dv.DvDriver' ,DRIVER_PACKAGE  '/home/db2inst1/sqllib/federation/jdbc/lib/dv-jdbc-3.1.201912091012.jar:/home/db2inst1/sqllib/federation/jdbc/lib/log4j-core-2.8.2.jar:/home/db2inst1/sqllib/federation/jdbc/lib/log4j-api-2.8.2.jar', URL 'jdbc:rs:dv://rs01.rocketsoftware.com:15082;LoginTimeoutSeconds=30;DatabaseType=SQL92;')

#create user mapping for user server server1 options(REMOTE_AUTHID 'SSIBM59',REMOTE_PASSWORD 'passw0rd')
#
 create nickname nk1 for server1."PB1A_TSDCV_TESTNUMBER"

# select c1,c2 from nk1 limit 2

C1          C2

----------- --------------------

          1                    1

          2                    2

  2 record(s) selected.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m500000008PkvAAE","label":"Federation"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
06 August 2020

UID

ibm11127601