If you are trying to install a jar file using sqlj.install_jar command and getting SQL4302N error, you may follow these steps to fix this problem. These may not work exactly in the same manner for you but it will give you some insight as how to fix this issue.

This problem generally occur due to either of the following.

1. Generally, if you have fenced user id different than instance user id.
2. Someone or you messed up with file permission in your instance directory.
3. Your java installed on the system is not compatible with DB2.
4. Your JDK_PATH is not set properly for your DB2 instance.

DB2 will try to install your jar file in ~/sqllib/function/jar directory using fenced user id and SQL error SQL4302N is related to the file permission issue in this directory which is owned by the instance user id.

Follow these steps to fix this issue:

$ rm -fr ~/sqllib/function/jar 
$ cd ~/sqllib/function 
$ mkdir jar 
$ chmod -R 777 jar 

$ db2 update dbm cfg using jdk_path /usr/java14_64 
$ db2stop force 
$ db2start 
$ db2 connect to yourdb

$ db2 "call sqlj.install_jar('file:/dir/yourfile.jar','jars.myjarid')" 

In the above example, /usr/java14_64 is the java home. The java home is the directory on top of bin directory. The jdk_path /usr/java14_64/bin is an invalid path.

If above steps do not work, consider looking through this article http://www.ibm.com/dw../dm-0510law/ to explore more on the error. If you found another way to fix this problem, send me a note at vikram(at)zinox.com and I will update this article so that it is helpful to others in the DB2 community.