airflow.providers.jdbc.hooks.jdbc¶
Module Contents¶
-
class
airflow.providers.jdbc.hooks.jdbc.JdbcHook[source]¶ Bases:
airflow.hooks.dbapi.DbApiHookGeneral 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.
-
set_autocommit(self, conn: jaydebeapi.Connection, autocommit: bool)[source]¶ Enable or disable autocommit for the given connection.
- Parameters
conn (connection object) -- The connection.
autocommit (bool) -- The connection's autocommit setting.
-
get_autocommit(self, conn: jaydebeapi.Connection)[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 (connection object) -- The connection.
- Returns
connection autocommit setting.
- Return type
-