There is no DB2.Licence property in the .net 8 version (or i can't find it). any idea ?
Also could someone explain what is this licence? i contacted the nuget team and they were kind enough tosend me a trial licence, but i don't know how to use it, and especially what i need to do to go in production ?
does it have to be installed in the DB2 server? and where to purchase the full license.
Original Message:
Sent: Mon December 18, 2023 10:26 PM
From: Sarwar Javaid
Subject: How to use DB2Connect license file for IBM Db2 .net provider nuget package?
IBM Db2 Connect is a licensed product that enables connectivity to Db2 databases. If you have a Db2 Connect license and you want to use the IBM Db2 .NET provider (IBM.Data.DB2) with a NuGet package, you can follow these steps to configure the license file:
Acquire the Db2 Connect License File: Ensure that you have a valid Db2 Connect license file. This file typically has a ".lic" extension.
Place the License File: Place the Db2 Connect license file in a location where your application can access it. You might want to put it in the same directory as your application executable or in a centralized directory.
Set the License File Path in Code: In your .NET application code, set the license file path before establishing a connection to the Db2 database. You can do this by using the DB2.License
property. Here's an example in C#:
using IBM.Data.DB2;
class Program
{
static void Main()
{
// Set the path to the Db2 Connect license file
DB2.License = "C:\\Path\\To\\Your\\LicenseFile.lic";
// Now, you can establish a connection to the Db2 database
string connectionString = "Database=YourDbName;UserID=YourUserId;Password=YourPassword;Server=YourDbServer;";
using (var connection = new DB2Connection(connectionString))
{
connection.Open();
// Perform database operations here
}
}
}
Replace "C:\\Path\\To\\Your\\LicenseFile.lic"
with the actual path to your Db2 Connect license file.
Deploy Your Application: Ensure that the Db2 Connect license file is deployed along with your application when you distribute it.
Check Connection: Verify that your application can connect to the Db2 database without any licensing issues.
By setting the DB2.License
property in your code, you explicitly specify the location of the Db2 Connect license file that the IBM Db2 .NET provider should use.
Remember that adhering to licensing agreements is crucial, and you should ensure that you have the right to distribute and use the Db2 Connect license in your application. If you encounter any issues or have specific questions about licensing.
------------------------------
Sarwar Javaid
Sr. Systems Engineer | Information Technology
Dollar Industries Pvt. Ltd. | D-85, S.I.T.E Area, Karachi
Cell: (+92) 346 2595970
Original Message:
Sent: Mon December 18, 2023 06:51 PM
From: Richard Rothe
Subject: How to use DB2Connect license file for IBM Db2 .net provider nuget package?
I cannot seem to be able to use the Contact owners link as you have recommended. How can I get a trial license to do a POC for my company (a VERY large iSeries customer). I have written a C# .Net 7 Web API that will just do Get on QIWS/QCUSTCDT to prove that we can connect to the iSeries using
<PackageReference Include="Net.IBM.Data.Db2" Version="7.0.0.200" />
<PackageReference Include="IBM.EntityFrameworkCore" Version="7.0.0.200" />
I am currently getting
IBM.Data.Db2.DB2Exception (0x80004005): ERROR [42968] [IBM] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968 when I do this in my Controller
var customerList = await _context.QCUSTCDTItems.Take(20).OrderByDescending(o => o.CUSNUM).ToListAsync();
------------------------------
Richard Rothe
Original Message:
Sent: Mon October 09, 2023 01:10 AM
From: Hosathota Vishwanatha
Subject: How to use DB2Connect license file for IBM Db2 .net provider nuget package?
Hi Furio,
On NuGet.org (https://www.nuget.org/packages/Net.IBM.Data.Db2/) there is an option "Contact owners -> " towards right side of the screen. You can use that option to send us a note about your requirement and we will respond.
Thanks
Vishwa
------------------------------
Hosathota Vishwanatha
Original Message:
Sent: Thu October 05, 2023 05:13 PM
From: Furio Filoseta
Subject: How to use DB2Connect license file for IBM Db2 .net provider nuget package?
Hi, my apologies for reviving this old thread. We're new to the IBM .NET provider and we understand we need a license. We did not know we could get a trial license. This would be ideal, so we can test our design assumptions. How can we get a trial license? I see you wrote "send us a message through NuGet" but I don't see how to do that. Again my apologies.
Regards
Furio Filoseta
------------------------------
Furio Filoseta
Original Message:
Sent: Sun March 26, 2023 11:43 PM
From: Hosathota Vishwanatha
Subject: How to use DB2Connect license file for IBM Db2 .net provider nuget package?
Hi Anand,
please send us a message through NuGet and we would share the details to get the trial license.
Thanks and regards
Vishwa
------------------------------
Hosathota Vishwanatha
Original Message:
Sent: Fri March 17, 2023 04:48 PM
From: Anand Anbalagan
Subject: How to use DB2Connect license file for IBM Db2 .net provider nuget package?
Hello Siva,
I am also trying to use IBM.Data.DB2.Core nuget package to connect to DB2 database from .Net Core 3.1 api. When I install the nuget packages, I couldn't see the license file in "C:\Users\<username>\.nuget\packages\ibm.data.db2.core\3.1.0.600\buildTransitive\clidriver\license" folder and not sure how/where to fetch the license file. Due to license file missing, am getting the error message "ERROR [42968] [IBM] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968" while opening the connection.
Please let me know if you find any solution.
------------------------------
Anand Anbalagan
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
------------------------------