JdbcHook

JDBC

General hook for jdbc db access.

View on GitHub

Last Updated: Nov. 3, 2022

Access Instructions

Install the JDBC provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

schemaOptional DB schema that overrides the schema specified in the connection. Make sure that if you change the schema parameter value in the constructor of the derived Hook, such change should be done before calling the DBApiHook.__init__().
log_sqlWhether to log SQL query when it’s executed. Defaults to True.

Documentation

General hook for jdbc db access.

JDBC URL, username and password will be taken from the predefined connection. Note that the whole JDBC URL must be specified in the “host” field in the DB. Raises an airflow error if the given connection id doesn’t exist.

Was this page helpful?