Original Message:
Sent: Thu October 09, 2025 10:36 AM
From: MOhit Negi
Subject: How to use DB2Connect license file for IBM Db2 .net provider nuget package?
Hey,
After reading above i understand the DB2 License required on DB2 server but still didn't see the answer for below line in the above comment.
// Set the path to the Db2 Connect license file
DB2.License = "C:\\Path\\To\\Your\\LicenseFile.lic";
i am using below version:
<PackageReference Include="Net.IBM.Data.Db2" Version="9.0.0.300" />
Here is my code.
public async Task<bool> TestConnectionAsync()
{
try
{
using var connection = new DB2Connection(_connectionString);
connection.Open();
var isOpen = connection.State == ConnectionState.Open;
_logger.LogInformation("DB2 connection test: {Status}", isOpen ? "Success" : "Failed");
return isOpen;
}
catch (Exception ex)
{
_logger.LogError(ex, "DB2 connection test failed");
return false;
}
}
So did you have to made any changes in the code after DB2 license install in DB2 Server or it just connected without any change. Also right now i am getting below issue. Are they also because of DB2 License or not?
{"ERROR [08001] [IBM] SQL30081N A communication error has been detected. Communication protocol being used: \"TCP/IP\". Communication API being used: \"SOCKETS\". Location where the error was detected: \"155.16.44.25\". Communication function detecting the error: \"connect\". Protocol specific error code(s): \"10061\", \"*\", \"*\". SQLSTATE=08001\r\n"}
------------------------------
MOhit Negi
Original Message:
Sent: Fri April 07, 2023 03:41 AM
From: Siva Sankaran
Subject: How to use DB2Connect license file for IBM Db2 .net provider nuget package?
Thank you @Tommy Petersen . So our database server should have this Db2 Connect license. Now I can understand that We don't need to do anything for license. I can be in peace now.
------------------------------
Siva Sankaran
Original Message:
Sent: Fri March 24, 2023 01:54 PM
From: Tommy Petersen
Subject: How to use DB2Connect license file for IBM Db2 .net provider nuget package?
Db2 Connect basically is the the license. The rest is just the IBM Data Server Client/Driver.
The license may have been already installed on the Db2 mainframe system, that way it is not needed on the client side.
If the license is not on the Db2 mainframe system it needs to be installed on the client, it is not enough to have a file, try to run "db2licm -l" to see if there is a license on the test and QA machines.
You can run "db2cli validate" with different options to check the connections, license etc.
------------------------------
Tommy Petersen
Original Message:
Sent: Tue March 07, 2023 03:21 AM
From: Siva Sankaran
Subject: How to use DB2Connect license file for IBM Db2 .net provider nuget package?
My workstation machine and our app servers(both prod & QA environments) are all got folders C:\Program Files\IBM\SQLLIB\ . It contains DB2 .net providers for older .net framework(C:\Program Files\IBM\SQLLIB\BIN\netf40_32). Our few old applications are using IBM DB2 ODBC Driver. But for application we can't use that since we can't find a working connection string which uses SSL Certificates as Authentication instead of password.
Now we have added NuGet Gallery | IBM.Data.DB2.Core 3.1.0.600 in our .net core application. During development and QA deployment, our app is working fine by connecting with Db2 (Does that mean we have license in place and no need to worry?). Now we are going to deploy to production server. I am worrying about whether we will face any issue due to license.
I learned that "existing DB2Connect license should work" from this faq. How to find whether we have DB2Connect license or not? This blog post says we need to place the license file in the specified path.
Currently I can find 2 files named "odbc_notices.rtf" , "odbc_REDIST.txt" in C:\Users\ {MyUserName} .nuget\packages\ibm.data.db2.core\3.1.0.600\buildTransitive\clidriver\license folder along with another folder named "Windows" which contains odbc_LI_en.rtf file. And also I can only find rtf files in this folder C:\Program Files\IBM\SQLLIB\license .
I want to ensure that our production deployment will connect with Db2 using IBM Db2 .NET Core Provider without any issue.
My questions are:
- How to verify whether my app servers have "Db2Connect" or not? I geuss we have DB2Connect as we have files in C:\Program Files\IBM\SQLLIB\. But we need a way to confirm this
- If yes, From where(license file path location) we can copy the license file?
- How to identify a license file ? what is the file extension?
- For local dev, To which location we need to paste the license file whether "C:\Users<MyUserName>.nuget\packages\ibm.data.db2.core\3.1.0.600\buildTransitive\clidriver\license" or C:\Users<MyUserName>\sourceCode\ApplicationProject\bin\Debug\netcoreapp3.1\clidriver
- For QA , Prod environment server deployment To which location we need to place the license file whether E:\apps\MyApplication\clidriver\license or "C:\Users<MyUserName>.nuget\packages\ibm.data.db2.core\3.1.0.600\buildTransitive\clidriver\license"
- Do we need license to use IBM .net provider dll in C:\Program Files\IBM\SQLLIB\BIN\netf40_32 ?
------------------------------
Siva Sankaran
------------------------------