Setting JVM Path for JDBC Operator in Astro CLI

Using JDBC operator require setup of JVM path. Any advice on how to do this if anyone is using JDBC Operator. Also which operator is preferred when accessing Postgres on AWS - Postgres or JDBC?

Thanks,

Sandeep

I would suggest looking into the Jdbc provider documentation.

You can find the necessary JAR for connecting to Postgres on the Postgres website. Once you have the JAR file, you can put it into your astro repository under include.

The JAR file can be referenced under /usr/local/airflow/include because the whole astro repository is mounted on the image.

Your Dockerfile should contain the JAVA home ENV var.

FROM quay.io/astronomer/ap-airflow:2.1.4-1-buster-onbuild

ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk

Install JAVA and required OS level packages in packages.txt.

libpq-dev
gcc
default-jre
default-jdk

Install python dependecies for JDBC in requirements.txt.

apache-airflow-providers-jdbc

Either way is fine but I think Postgres operator is easier to use.