Forum Discussion

abhinaykumar15's avatar
abhinaykumar15
Occasional Contributor
5 months ago

Error connecting to Postgress DB in ReadyAPI 3.52.0

Hi Team,

I am getting the following while adding a database connection(JDBC coonection step)

   Failed to connect: FATAL: no pg_hba.conf entry for host "xxx.xx.xxx.xxx",     user "Testuser", database "Testdatabase", no     encryption.

I tried using the no ssl solution mentioned in other post sslfactory=org.postgresql.ssl.NonValidatingFactory  but that is also not working.

  • The issue got resolved after i used the latest version of Postgress driver postgresql-42.7.3

  • richie's avatar
    richie
    Community Hero

    Hey @abhinaykumar15

    it's not a timeout, right?  You're definitely not timing out and instead the connection is refused? That leads me to think you've got some of the details correct but not all. 

    Some RDBMSs include some optional parameters that are needed to be specified in the JDBC connection string (thinking mostly SQLServer here - but other RDBMSs do include some optionals as well). 

    Can you confirm the JDBC connection string details from any of your work colleagues?  Whenever I'm trying to setup a DB connection, I tend to check my JDBC connection details using a DB interrogation tool first (e.g. TOAD, DBeaver, DBVisualiser, etc.) rather than mess around in ReadyAPI! first.  If the string works in one of these tools, then the string should work in ReadyAPI! 

    By the way - whenever I have to setup a DB connection - I run through the following steps:

    1. Identify the Vendor and version of RDBMS I'm trying to connect to
    2. Identify the correct JDBC drivers for the version of RDBMS I want to connect o
    3. Identify the version of JRE/JDK that supports the relevant the JDBC drivers I need to use (making sure I'm using the correct 'bit type' - either 32bit of 64bit)
    4. Determine the JDBC connection string needed to connect to relevant RDBMS (including any of the optional parms if necessary) 

    Cheers,

    rich

  • abhinaykumar15's avatar
    abhinaykumar15
    Occasional Contributor

    The issue got resolved after i used the latest version of Postgress driver postgresql-42.7.3