Question & Answer
You might encounter the following error when trying to connect using the DB2 Universal JDBC Driver (Type-4) to a database that is catalogued with an authentication type of SERVER_ENCRYPT: com.ibm.db2.jcc.a.SqlException: Connection authorization failure occurred. Reason: security mechanism not supported.
This might occur when using a version of the IBM® Java™ development kit (JDK) that does not have 256 key size support.
If you collect JDBC trace data, you will see an exception like this:
7][SQLException@9d23845][Throwable@9b03845] Message = Prime size must be
multiple of 64, and can only range from 512 to 1024 (inclusive)
Use a version of the IBM JDK that has 256 key size support. JDK versions 1.4.2 SR1 and above have 256 key size support.
You can run the command java -version to check the JDK version.
16 June 2018