IBM Data Server Drivers (Db2 Connect Client)

 View Only

Downloading and initial configuration of Db2 .NET NuGet Packages

By Hosathota Vishwanatha posted Sun July 12, 2020 11:33 PM

  

The article lists the basic information needed to use the Db2 .NET Driver packages. The write up captures the important information on choosing the Db2 .NET drivers, downloading and configuring them for first use. The document will not go into any specific application scenarios as they are covered in detail in other blogs.

Recommended latest IBM Db2 .NET drivers
For .NET 6 based applications
Db2 .NET driver for Microsoft .NET 6 (The package name is Net.IBM.Data.Db2
IBM EntityFrameworkCore for ,NET 6

For .NET5 based applications
Db2 .NET driver for Microsoft .NET 5(The package name is Net5.IBM.Data.Db2)
IBM EntityFrameworkCore for .NET 5

For .NET Core based applications
Db2 .NET Core 3.1.0.400
IBM EntityFrameworkCore 3.1.0.400

For .NET Framework based applications
EntityFramework 6.4 (For .NET Framework)


Supported platforms and download link for Db2 .NET Core 3.1 packages

Supported Operating Systems:

  1. Windows x64
  2. Linux AMD64(known exception Alpine Linux)
  3. MacOS

All packages are available for download from NuGet repository.

 
License requirements

Version

IBM license version

To be placed at

6.0.0.<version>

V11.5*

C:\Users\<users>\.nuget\packages\net.ibm.data.db2\6.0.0.<version>\buildTransitive\clidriver\license

5.0.0.200

V11.5*

C:\Users\<users>\.nuget\packages\net5.ibm.data.db2\5.0.0.200\buildTransitive\clidriver\license

3.1.0.400

V11.5*

C:\Users\<users>\.nuget\packages\ibm.data.db2.core\3.1.0.200\buildTransitive\clidriver\license

2.2.0.100

V11.5

C:\Users\<users>\.nuget\packages\ibm.data.db2.core\2.2.0.100\build\clidriver\license

2.0.0.100

V11.5

C:\Users\<users>\.nuget\packages\ibm.data.db2.core\2.0.0.100\build\clidriver\license

*Notes:

  • Starting with .NET Core 3.1.0.200, the license files are to be placed inside the buildTransitive folder instead of the build folder earlier. For example:

          On Windows:

                  C:\Users\<username>\.nuget\packages\ibm.data.db2.core\<version>\buildTransitive\clidriver\license

          On Linux:

                  $HOME/.nuget/packages/ibm.data.db2.core-lnx/<version>/buildTransitive/clidriver/license

           On MacOS:

                  /Users/<username>/.nuget/packages/ibm.data.db2.core-osx/<version>/buildTransitive/clidriver/license

  • For versions prior to Db2 .NET Core 3.1, the value “ <version>\buildTransitive\” above should be changed to “<version>\build\” where version refers to Db2 .NET Core version.
  • For Db2 .NET 5, the value packages\ibm.data.db2.core\ should be replaced by packages\net5.ibm.data.db2\ since there is a change in package name.
  • For Db2 .NET 6, the value packages\ibm.data.db2.core\ should be replaced by packages\net.ibm.data.db2\
  • On Azure Environment, the environment variable DB2_COMMON_APP_DATA_PATH should be set to be a writable location. This is one of the common issues noticed in recent times for license error -1598. After setting the above environment variable, its important to make sure the path has write permission.

Related Db2 .NET package blogs

For .NET Core packages, follow the below link to get started and explore more scenarios with Db2 .NET Core packages.

Getting Started with IBM Data Provider for .NET Core and .NET 5

 
Breaking changes in Db2 .NET 6

  • There is a change in the package name for .NET runtime and is changed to Net.IBM.Data.Db2. This name will remain same for future versions also.
  • In some docker related scenarios, the path of clidriver\bin may need to be added to path variable.


Breaking changes in Db2 .NET 5

  • There is a change in the package name for .NET runtime and is changed to Net5.IBM.Data.Db2.
  • The assembly namespace has changed to IBM.Data.Db2. It was IBM.Data.DB2.Core for Db2 .NET Core packages.
  • Version 5.0.0.400(latest) -- Support for Row Change Timestamp columns with IBM EF Core provider.

Enhancements and breaking changes in Db2 .NET Core 3.1

List of enhancements in Db2 .NET Core 3.1 is available at:

https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.wn.doc/doc/c_net_provider_enhancements.html

Known limitations

Please refer to known limitations page for set of known limitations.

Last updated On 6th September 2022

7 comments
316 views

Permalink

Comments

Tue October 19, 2021 04:28 AM

Hi,
 you can use the regular connection string below by replacing values inside <>
"server=<yourInformixServer>:9172;uid=<youruserid>;pwd=<yourpassword>;database=<yourdatabase>"

No license is needed for connecting to Informix server.

Thanks
Vishwa

Thu October 07, 2021 04:36 PM

Dear,

I find myself wanting to develop solutions using .Net Core 3.1 and Entity FrameWork. I would need it to happen to me in the first instance, how should I build my connection string to connect to an Informix database? How can we access a trial license to be able to use the entity framework? And where are the costs of acquiring the license for connection to informix via entity Framework?

Thanks.

Wed September 02, 2020 02:32 AM

Hi Vishwa!

Thanks for the answer, yes IBM support contacted and I found a useful link about the same problem, https://stackoverflow.com/questions/59270598/using-entity-framework-with-net-core-and-db2

Regards
Denny

Sun August 30, 2020 10:11 PM

Hi Denny,
 can you please contact IBM support for this? Have you used a trial license. If not, please request for the same.

Thanks
Vishwa

Mon August 24, 2020 03:12 AM

Hello!
I am having big problems connecting to DB2 database.
Visual Studio 2019, .NET Core 3.1 and IBM.Data.DB2.Core(3.1.0.200)

Version of IBM DB2
07.01.0000 OS/400 V7R1M0

Unhandled exception. IBM.Data.DB2.Core.DB2Exception (0x80004005): ERROR [42968]

[IBM] SQL1598N  An attempt to connect to the database server failed because of a

 licensing problem.  SQLSTATE=42968

 
So i checked, https://www.ibm.com/support/pages/node/491081

Ran db2level command,

d:\progapp\tccm\NETCORE\DB2\clidriver\bin>db2level.exe

DB21085I  This instance or install (instance name, where applicable: "*") uses

"64" bits and DB2 code release "SQL11054" with level identifier "0605010F".

Informational tokens are "DB2 v11.5.4000.1449", "s2006161200",

"DYN2006161200WIN64", and Fix Pack "0".

Product is installed at "d:\progapp\tccm\NETCORE\DB2\clidriver" with DB2 Copy

Name "IBM Data Server Driver For ODBC and CLI".

Running db2diag command:

2020-08-26-12.10.29.274000+120 E10403F846           LEVEL: Error

PID     : 17028                TID : 14060          PROC : ImportTrygg.exe

INSTANCE:                      NODE : 000           DB   : DKDDTUDV

APPID   : 10.219.74.174.54585.200826101029

HOSTNAME: A04633

EDUID   : 14060

FUNCTION: DB2 UDB, Connection Manager, sqleuPerformServerActivationCheck, probe:

110

MESSAGE : ADM12008C  The product "IBM Data Server Driver For ODBC and CLI" does

 

          not have a valid license key installed and the evaluation period has

          expired. Functions specific to this product are not enabled. If you

          have licensed this product, ensure the license key is properly

          installed. You can install the license using the db2licm command. The

 

          license file can be obtained from your licensed product CD.

 

db2diag invoked with the default set of filtering/formatting options

on file "D:\progapp\tccm\NETCORE\DB2\clidriver\bin\db2diag.log".

Enter "db2diag -h" to get a short description of all available options.


My customers version of DB2 is V7R1M000 and iSeries(former AS/400?). What shall I do in order to get things right?
Is it even possible/doable with current versions?

Where do I find the license file needed? If any needed....
I am building my project locally and then want to deploy it on our customers server....
Thanks.

Best Regards
Denny Pedersen

Fri August 14, 2020 03:38 AM

Hi Nuno,
  we have a dependency on unmanaged dlls to achieve the lower level database interactions and they are different for different platforms. We tried to combine them into single package but then the size of the package becomes three times the current size and idea was dropped. At this point, we only have three separate drivers for three platforms.

Please feel free to open an Aha request(https://ibm-data-and-ai.ideas.aha.io/ideas?project=DB2CON )  and we can prioritize in future if there are enough requests for the same.

Thanks
Vishwa

Wed August 12, 2020 04:29 PM

Greetings,

Hope that you are doing well.

I was wondering, what is the difference between the nuget of netcore 3.1? Why there are 3 nugets, one for each environment?

It turns more, way more, complex the development process and the build pipelines for the projects. I can't have the team developing the projects (regardless the Operating System) with different nuggets differ from OS to OS. The same apply to CI/CD pipelines which may build on Windows agents or Linux agents. Further more on deploy, I may deploy it on containers, Cloud, Windows or even on *nix environments.

Did I miss something? 

I appreciate the feedback.

Best Regards
Nuno Cancelo