airflow.providers.jdbc.hooks.jdbc

Module Contents

Classes

JdbcHook

General hook for jdbc db access.

class airflow.providers.jdbc.hooks.jdbc.JdbcHook(*args, schema=None, **kwargs)[source]

Bases: airflow.hooks.dbapi.DbApiHook

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.

conn_name_attr = jdbc_conn_id[source]
default_conn_name = jdbc_default[source]
conn_type = jdbc[source]
hook_name = JDBC Connection[source]
supports_autocommit = True[source]
static get_connection_form_widgets()[source]

Returns connection widgets to add to connection form

static get_ui_field_behaviour()[source]

Returns custom field behaviour

get_conn(self)[source]

Returns a connection object

set_autocommit(self, conn, autocommit)[source]

Enable or disable autocommit for the given connection.

Parameters
  • conn (jaydebeapi.Connection) -- The connection.

  • autocommit (bool) -- The connection's autocommit setting.

get_autocommit(self, conn)[source]

Get autocommit setting for the provided connection. Return True if conn.autocommit is set to True. Return False if conn.autocommit is not set or set to False

Parameters

conn (jaydebeapi.Connection) -- The connection.

Returns

connection autocommit setting.

Return type

bool

Was this entry helpful?