Mainframe CICS DB2 : Security mechanism not supported

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:

jdbc:db2://SERVERNAME:3700/DB:securityMechanism=7;

securityMechanism
Specifies the DRDA security mechanism. The data type of this property is int. Possible values are:

CLEAR_TEXT_PASSWORD_SECURITY (3)
User ID and password

USER_ONLY_SECURITY (4)
User ID only

ENCRYPTED_PASSWORD_SECURITY (7)
User ID, encrypted password

ENCRYPTED_USER_AND_PASSWORD_SECURITY (9)
Encrypted user ID and password

KERBEROS_SECURITY (11)
Kerberos. This value does not apply to connections to IDS.

ENCRYPTED_USER_AND_DATA_SECURITY (12)
Encrypted user ID and encrypted security-sensitive data. This value applies to connections to DB2 for z/OS only.

ENCRYPTED_USER_PASSWORD_AND_DATA_SECURITY (13)
Encrypted user ID and password, and encrypted security-sensitive data. This value does not apply to connections to IDS.

PLUGIN_SECURITY (15)
Plug-in security. This value applies to connections to DB2 Database for Linux, UNIX, and Windows only.

ENCRYPTED_USER_ONLY_SECURITY (16)
Encrypted user ID. This value does not apply to connections to IDS.

Leave a Reply

Your email address will not be published. Required fields are marked *