Can you check for a DB2 license in C#?

177 views Asked by At

I've written a WPF app in C# (4.5) and it connects to a DB2 server. I want to know if there's a way to check the local machine for a valid DB2 license and display a warning if it's not found.

2

There are 2 answers

0
AngocA On BEST ANSWER

There is not an api to access the license manager in DB2. However, you have two options:

  • Execute the db2licm and parse the output.
  • Analyse the nodelock file in the license directory where db2 is installed (/opt/ibm/db2/V10.5/license/nodelock)
0
C_B On

You have to run the db2licm command to check the DB2 license.

Click here to see how to run DB2 commands in C#.