I was writing a code to access DB2 in CICS where I encountered this error. This error encounters when you are trying to access a secured Db with default options. In order to get this working, you have to specify ‘securityMechanism’ property in your connection string with value as supported by server, see below:
Specifies the DRDA security mechanism. The data type of this property is int. Possible values are:
User ID and password
User ID only
User ID, encrypted password
Encrypted user ID and password
Kerberos. This value does not apply to connections to IDS.
Encrypted user ID and encrypted security-sensitive data. This value applies to connections to DB2 for z/OS only.
Encrypted user ID and password, and encrypted security-sensitive data. This value does not apply to connections to IDS.
Plug-in security. This value applies to connections to DB2 Database for Linux, UNIX, and Windows only.
Encrypted user ID. This value does not apply to connections to IDS.