Tomcat: How To Connect to DB2 with Security Enabled
search cancel

Tomcat: How To Connect to DB2 with Security Enabled

book

Article ID: 293331

calendar_today

Updated On:

Products

VMware Tanzu tc Server

Issue/Introduction

Symptoms:

You see the following error when connecting to the DB2 database using JDBC connection pool.

javax.naming.NamingException: [jcc][t4][201][11237][3.65.131] Connection authorization
 failure occurred. Reason: Security mechanism not supported. ERRORCODE=-4214 SQLSTATE=280 

    

Environment


Cause

When the parameter AUTHENTICATION is set to SERVER_ENCRYPT, you need to give some extra configuration commands to the connection pool resource.

Resolution

Add the following attribute to the connection pool resource configuration:

connectionProperties="securityMechanism=9;encryptionAlgorithm=2"

The resource configuration should look like this:

<Resource name="jdbc/TestDB"
 auth="Container"
 type="javax.sql.DataSource"
 factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
 testWhileIdle="true"
 testOnBorrow="true"
 .
 .
 .
connectionProperties="securityMechanism=9;encryptionAlgorithm=2" />