Problem
The DB2 JDBC Driver requires a license file to be available on the classpath when connecting to certain types of DB2 instances. The license file is not bundled in the driver, which results in errors like:
java.lang.RuntimeException: java.lang.RuntimeException: com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][t4][10509][13454][4.26.14] 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 License is available in separate jar file as per IBM documentation. https://www.ibm.com/support/pages/db2-jdbc-driver-not-licensed-connectivity-file-db2jcclicensecisuzjar-errorcode-4472-sqlstate42968 Resolving The Problem To resolve the error you must add the appropriate DB2 JDBC license file to the applications CLASSPATH environment variable. If you are connecting to a host (z/OS or iSeries) then you need to add the db2jcc_license_cisuz.jar file.
Solution(s)
Install the DB2 JDBC jar locally to maven repo:
mvn install:install-file -Dfile=/path to driver/db2jcc4.jar \ -DgroupId=com.ibm.db2.jcc \ -DartifactId=db2jcc4 \ -Dversion=10.1 \ -Dpackaging=jar \ -DlocalRepositoryPath=/Users/username/.m2/repository
Install the license jar locally to maven repo:
mvn install:install-file -Dfile=/path to driver/db2jcc_license_cisuz4.jar \ -DgroupId=com.ibm.db2 \ -DartifactId=db2jcc_license_cisuz4 \ -Dversion=11.5.0.0 \ -Dpackaging=jar \ -DlocalRepositoryPath=/Users/username/.m2/repository
Using the attached pom.xml, build the combined jar:
mvn clean package
Deploy the jar under the target directory as a JDBC plugin in Data Fusion