Module Contents

class airflow.operators.jdbc_operator.JdbcOperator(sql, jdbc_conn_id='jdbc_default', autocommit=False, parameters=None, *args, **kwargs)[source]

Bases: airflow.models.BaseOperator

Executes sql code in a database using jdbc driver.

Requires jaydebeapi.

  • sql (Can receive a str representing a sql statement, a list of str (sql statements), or reference to a template file. Template reference are recognized by str ending in '.sql') – the sql code to be executed. (templated)

  • jdbc_conn_id (str) – reference to a predefined database

  • autocommit (bool) – if True, each command is automatically committed. (default value: False)

  • parameters (mapping or iterable) – (optional) the parameters to render the SQL query with.

template_fields = ['sql'][source]
template_ext = ['.sql'][source]
ui_color = #ededed[source]
execute(self, context)[source]