Data Management Global

 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 8 based applications
Db2 .NET driver for Microsoft .NET 8
IBM EntityFrameworkCore for .NET 8


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

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 Framework based applications
EntityFramework 6.4 (For .NET Framework)

Supported platforms and download link for Db2 .NET 6,  .NET 7 and .NET 8 Packages

Supported Operating Systems:

  1. Windows x64
  2. Linux AMD64(known exception Alpine Linux)
  3. MacOS
  4. Linux on IBM Z (new)

All packages are available for download from NuGet repository.

 
License requirements

.NET Version

License version

To be placed at

.NET 6 and above

V11.5*

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

.NET 5

V11.5*

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

*Notes:

  • The VERSION above corresponds to NuGet package version and examples include 5.0.0.300, 6.0.0.400 and 8.0.0.100.
  • 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 and above, 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 6 and .NET 7

 
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.


Known limitations

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

Last updated On 6th February 2024


#DataManagementGlobal
#DataServerDrivers

9 comments
490 views

Permalink

Comments

Fri December 15, 2023 11:38 AM

I have created a C# 7 Web API with EF using Net.IBM.Data.Db2 and IBM.EntityFrameworkCore.  It appears to be connecting to the iSeries and then returns :

IBM.Data.Db2.DB2Exception (0x80004005): ERROR [08004] [IBM] SQL30061N  The database alias or database name "filename    " was not found at the remote node.  SQLSTATE=08004

Connection string :

"Server=xxx.xxx.com:446; Database=filename; UID=*****; PWD=*****;"
There is very little information out there regarding how to configure this.  Any help is appreciated !
It is connecting and returning data in a console app that uses ODBC

Fri January 20, 2023 12:08 PM

Hi,

I have an Azure Function that is throwing the following exception: 

IBM.Data.DB2.Core.DB2Exception (0x80004005): ERROR [58005] [IBM][DB2.NET] SQL0902 An unexpected exception has occurred in Process: 4992 Thread 59 AppDomain: Name:Microsoft.Azure.WebJobs.Script.WebHost There are no context policies. Function: AESEncryptADONET (Encryption Info) CallStack: at System.Environment.get_StackTrace() at IBM.Data.DB2.Core.DB2ConnPool.HandleUnknownErrors(String strFncMsg, Exception exception, Boolean bThrow) at IBM.Data.DB2.Core.DB2ConnPool.EncryptString(String value) at IBM.Data.DB2.Core.DB2ConnPool.ReplaceConnectionStringParms(DB2Connection connection, String szValue, DB2ConnSettings& pSettings, DB2ConnSettingsInternal& pSettingsInternal, Boolean bAttach, Boolean pushDownStrAppended) at IBM.Data.DB2.Core.DB2Connection.set_ConnectionString(String value) at IBM.Data.DB2.Core.DB2Connection..ctor(String connectionString) at stuff_logs_logic.StuffLogsRepository.OpenConection() 

I appreciate any feedback!
Thanks,
Luis

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