Bookmark and Share

Configuring Mainframe DB2 on Windows Server 2008 via a gateway

You can find the DB2 configuration files on c:\ProgramData\IBM\DB2\[INSTANCENAME]\cfg. IBM has changed the way their drivers are configured. You still have a ini file called db2cli.ini which functions the same way as it used to,but they added a new configuration file called db2dsdriver.cfg.

Here's an example of a mainframe db2 configuration. Your DSN in ODBC would be named 'DB2TestDSN'.

		  <dsn alias="DB2TestDSN" name="DB2Test" host="" port="5204"/>
		  <database name="DB2Test" host="" port="5204">
			 <parameter name="CurrentSchema" value="MySchema"/>
				<parameter name="enableWLB" value="true"/>
				<parameter name="maxTransports" value="50"/>
				<parameter name="enableACR" value="true"/>
		<parameter name="connectionSupervisorLibrary" value=""/>
		<parameter name="connectionSupervisorProperties" value="controllerURL="/>

Take note that there are TWO odbc configuration interfaces on Windows Server 2008 64 bit. 32 and 64 bit. 32 bit admin interface can be found at 'C:\Windows\SysWOW64\odbcad32.exe' and through it you can configure your data sources for 32 bit applications like Classic ASP via IIS. Classic ASP will not be able to use the 64 odbc interface. .Net and ASP.Net will use the 64 version, although you probably won't use the odbc interface to configure a DSN for it since you can specify all the connection properties via your connectionstring.

To validate the db2dsdriver.cfg file you can use the following command: 'db2cli validate -dsn DB2TestDSN'

Take note that the IBM drivers do not uninstall correctly. You might have to resort to manually removing ODBC registry settings to remove rogue ODBC datasource drivers if you run into issues and uninstall/reinstall drivers. [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC] is the place to go for that.