How to connect PostgreSQL from Databricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2019 12:11 AM
I am trying to connect PostgreSQL from Azure Databricks.
I am using the below code to connect.
jdbcHostname = "Test"
jdbcPort = 1234
jdbcDatabase = "Test1"
jdbcUrl = "jdbc:postgresql://{0}:{1}/{2}".format(jdbcHostname, jdbcPort, jdbcDatabase)
Connection was successful
connectionProps = { "user": "userid", "password": "pass!" }
Now, when I run the below command
accountDF = spark.read.jdbc(url=jdbcUrl, table="POC_TABLE", properties=connectionProps) display(accountDF)
I get the below error.
org.postgresql.util.PSQLException: FATAL: SSL connection is required. Please specify SSL options and retry.
How do I fix this error. I have SSL enabled in the postgreSQL at Azure portal.
Regards,
Akash
- Labels:
-
Azure databricks
-
Postgresql