We are currently porting an app that used to go against MS SQL to not work with DB2. It is not a production app yet, but the conversion is going smoothly. We should be able to switch databases without changing a single line of compiled code. We are porting to DB2 9.5. I'll include the provider config that we are using.
<provider name="db2.9"
enabled="true"
default="true"
assemblyName="IBM.Data.DB2, Version=9.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208"
connectionClass="IBM.Data.DB2.DB2Connection"
commandClass="IBM.Data.DB2.DB2Command"
parameterClass="IBM.Data.DB2.DB2Parameter"
parameterDbTypeClass="IBM.Data.DB2.DB2Type"
parameterDbTypeProperty="DB2Type"
dataAdapterClass="IBM.Data.DB2.DB2DataAdapter"
commandBuilderClass="IBM.Data.DB2.DB2CommandBuilder"
usePositionalParameters="true"
useParameterPrefixInSql="false"
useParameterPrefixInParameter="true"
parameterPrefix="@"
caseSensitive="false"/>
This uses the current .Net DB2 Provider downloaded from IBM for DB2 9.5. I'll explain the last two attributes as they are not standard. The first one we switched to use the @ symbol. DB2 does not have enforced parameter prefixes. We decided to keep SQL Server's so it would be easier to port the stored procedures. The last attribute is one that I have added to iBATIS.NET. I can commit it if people feel it is useful. The way the DB2 provider presents the stored procedure parameters is all upper case. This switch makes procedure parameter name matching case insensitive.
Hope this helps.
Mike