Forum Discussion

JimmyGM's avatar
JimmyGM
New Contributor
3 years ago

Connecting to Yugabyte Via JDBC

Has anyone had any success is using JDBC connection built within ReadyAPI to connect to Yugabyte? I didn't see much topics around this and wanted to ask for some guidance.

  • CoreyVernon's avatar
    CoreyVernon
    SmartBear Alumni (Retired)

    It seems that Yugabyte provides a JDBC driver based on Postgresql. This connection can be established in ReadyAPI by providing the connection string. I have provided links to the ReadyAPI documentation that walks through connecting to JDBC databases as well as the github repo for the Yugabyte Postgresql JDBC connection.  

     

    https://support.smartbear.com/readyapi/docs/testing/data-driven/tutorials/jtds/jdbc.html?sbsearch=JDBC%20connection

    https://github.com/yugabyte/pgjdbc

     

    I hope this information helps guide you,

     

    Corey

    • JimmyGM's avatar
      JimmyGM
      New Contributor

      Thanks CoreyVernon 

       

      I did download the latest postgres jar :"postgresql-42.3.2.jar" and it is currently in my bin/ext

      I tried to set this up as per your instruction but I'm currently getting this error.

       

      Failed to initialize the connection that uses the [Yugabyte/org.postgresql.Driver] driver. Connection string: [jdbc:yugabytedb://URL:PORT/KEYSPACE?user=USERID&password=#####].

       

      This is my current Driver within my JDBC preference. 
      Yugabyte/org.postgresql.Driver.

       

      Is there a specific connection string I should be following?

       

      Regards,

      Jimmy

      • JimmyGM's avatar
        JimmyGM
        New Contributor

        Update:
        I actually downloaded the Yugabyte JDBC driver so this is my current setup.

         

        Driver: com.yugabyte.Driver

        jdbc:yugabytedb://URL:9042/KEYSPACE?user=USERID&password=PASS_VALUE

         

        Now I'm getting:
        Failed to get a connection for the specified properties; com.yugabyte.util.PSQLException: An error occurred while setting up the SSL connection.

         

        Regards,

        Jimmy