I've installed Db2 Connect in Windows and I load the license successful:
Product name: "DB2 Connect Enterprise Edition"
License type: "Client Device"
Expiry date: "Permanent"
Product identifier: "db2consv"
Version information: "11.1"
When I'm trying to connect with JDBC it indicates there is a license error:
java -cp %CLASSPATH%;./db2jcc.jar com.ibm.db2.jcc.DB2Jcc -url jdbc:db2://xx.yy.zz.pp:port/DB -user USER -password PASSWORD -db2ConnectVersion "C:\Program Files\IBM\SQLLIB\java\db2jcc_license_cu.jar"
[jcc][10521][13706]Command : java com.ibm.db2.jcc.DB2Jcc -url jdbc:db2://xx.yy.zz.pp:port/DB -user USER -password ******** -db2ConnectVersion C:\Program Files\IBM\SQLLIB\java\db2jcc_license_cu.jar
DB2 V11.1
[jcc][10512][13714]Failed to create connection.
SQLCODE: -4230
SQLSTATE: 42968
Message: [jcc][t4][10509][13454][3.72.54] Connection to the data server failed. The IBM Data Server for JDBC and SQLJ license was invalid
or was not activated for the DB2 for z/OS subsystem. If you are connecting directly to
the data server and using DB2 Connect Unlimited Edition for System z, perform the
activation step by running the activation program in the license activation kit.
If you are using any other edition of DB2 Connect, obtain the license file,
db2jcc_license_cisuz.jar, from the license activation kit, and follow the installation
directions to include the license file in the class path. ERRORCODE=-4230, SQLSTATE=42968
Anyone can help me please?
The issue is that the Db2 JDBC driver has a need for a license file. You need to supply this on the class path which you are not currently doing.
Your original command is:
Change it to:
Review this article from IBM on how to use the Db2 License Files
Also, you might review this Stack Overflow question Where can I get these two jars - db2jcc4_license_cu and db2jcc4_license_cisuz?