Bookmark and Share BitCoin Donate: 13t8gAWVpHP2ddxMp88d1NFpZjnFJC6UwK

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'.

	<configuration>
	   <dsncollection>
		  <dsn alias="DB2TestDSN" name="DB2Test" host="test.mainframe.net" port="5204"/>
	   </dsncollection>
	   <databases>
		  <database name="DB2Test" host="test.mainframe.net" port="5204">
			 <parameter name="CurrentSchema" value="MySchema"/>
			 <wlb>
				<parameter name="enableWLB" value="true"/>
				<parameter name="maxTransports" value="50"/>
			 </wlb>
			 <acr>
				<parameter name="enableACR" value="true"/>
			 </acr>
		  </database>
	   </databases>
	   <parameters>
		<parameter name="connectionSupervisorLibrary" value=""/>
		<parameter name="connectionSupervisorProperties" value="controllerURL="/>
	   </parameters>
	</configuration>

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.