Q1IM error database error 20103

I m facing an issue with Q1IM where I m doing a POC by installing Q1IM v6.1.4 on WS2016. This version of Q1IM officially does not supports WS2016, but as we are doing the POC. WS2016 is deployed in AWS and all the required ports are opened between AWS and the on-prem network. After installing the Q1IM, when trying to connect with DB getting the error "Database error 0: server did not respond within the specified timeout interval". I have tried by changing the Timeout interval period from default 15 to 0, even then getting the same result. Once in a while it connects but the next moment, it gives the same result. When it succeeds the connectivity test, then I m receiving the "Database error 20103". I m able to do the telnet from the AWS server to the on-prem DB server.

Any suggestion?