JDBC connection¶
The JDBC connection type enables connection to a JDBC data source.
Configuring the Connection¶
- Host (required)
The host to connect to.
- Schema (required)
Specify the database name to be used in.
- Login (required)
Specify the user name to connect to.
- Password (required)
Specify the password to connect to.
- Port (optional)
Port of host to connect to. Not user in
JdbcOperator.- Extra (optional)
Specify the extra parameters (as json dictionary) that can be used in JDBC connection. The following parameters out of the standard python parameters are supported:
driver_classFull qualified Java class name of the JDBC driver. For
JdbcOperator. Note that this is only considered ifallow_driver_class_in_extrais set to True in airflow config sectionproviders.jdbc(by default it is not considered). Note: if setting this config from env vars, useAIRFLOW__PROVIDERS_JDBC__ALLOW_DRIVER_CLASS_IN_EXTRA=true.
driver_pathJar filename or sequence of filenames for the JDBC driver libs. For
JdbcOperator. Note that this is only considered ifallow_driver_path_in_extrais set to True in airflow config sectionproviders.jdbc(by default it is not considered). Note: if setting this config from env vars, useAIRFLOW__PROVIDERS_JDBC__ALLOW_DRIVER_PATH_IN_EXTRA=true.
Note
Setting
allow_driver_path_in_extraorallow_driver_class_in_extrato True allows users to set the driver via the Airflow Connection’sextrafield. By default this is not allowed. If enabling this functionality, you should make sure that you trust the users who can edit connections in the UI to not use it maliciously.