Registering the ODBC wrapper

You must register a wrapper to access ODBC data sources. Federated servers use wrappers to communicate with and retrieve data from data sources. Wrappers are implemented as a set of library files.

Procedure

Use one of the following methods:
Method Description
Issue the CREATE WRAPPER statement from the command line and specify the default name for the ODBC wrapper.
For example:
CREATE WRAPPER ODBC; 
Remember: When you register the wrapper by using the default name, ODBC, the federated server automatically uses the appropriate ODBC wrapper library for the operating system that your federated server is running on.
You must specify the MODULE wrapper option on federated servers that run Linux® or UNIX. The MODULE wrapper option specifies the full path of the library that contains the ODBC Driver Manager.
CREATE WRAPPER ODBC 
	OPTIONS (DB2_FENCED 'Y', 
	MODULE '/home/iidev24/sqllib/federation/odbc/lib/libodbc.so')
For AIX®, if you are configuring access to IBM® InfoSphere® Classic Federation Server for z/OS® data sources and use a 32-bit IBM InfoSphere Classic Federation Server for z/OS client, you must specify the DB2_FENCED and DB2_SOURCE_CLIENT_MODE options as shown in the following example.
CREATE WRAPPER ODBC 
	LIBRARY 'libdb2rcodbc.a' 
	OPTIONS (DB2_FENCED 'Y', 
		DB2_SOURCE_CLIENT_MODE '32BIT', 
	MODULE '/opt/IBM/DB2IIClassic82/cli/lib/cacsqlcli.so')
The DB2_SOURCE_CLIENT_MODE is supported on AIX only.
Issue the CREATE WRAPPER statement from the command line and specify an alternative name for the ODBC wrapper.

If the default wrapper name conflicts with an existing wrapper name in the federated database, you can substitute the default wrapper name with a name that you choose. When you use a name that is different from the default name, you must include the LIBRARY parameter in the CREATE WRAPPER statement.

For example, to register a wrapper with the name odbc_wrapper on a federated server that uses AIX, issue the following statement:
CREATE WRAPPER odbc_wrapper 
  LIBRARY 'libdb2rcodbc.a' 
  OPTIONS(MODULE '/home/db2inst1/sqllib/federation/odbc/lib/odbc.so')

The wrapper library file that you specify depends on the operating system of the federated server.

What to do next

After you complete this task, you can register the server definitions.
Note: You can register a wrapper to access Db2® family data sources. If you do not create a wrapper, create server statement creates a default wrapper implicitly, however, you must specify the server type such as ORACLE_ODBC, MSSQL_ODBC, MYSQL, MYSQL_CE, MARIADB, POSTGRESQL, GREENPLUM, HIVE, SPARK, HANA, IMPALA, Netezza, etc.