def METHOD_NAME(self, engine, connect_args: dict, autocommitable: bool = False):
    self._engine = engine  # imported external library that connects to the DB
    self.logger.debug(f"Connecting to database with connect_args: {connect_args}.")
    try:
        self.con = self._engine.connect(**connect_args)
        if autocommitable:  # psycopg2 and mssql has it, sqlite3 has not
            self.con.autocommit = getattr(self, 'autocommit', True)  # True prevents deadlocks
        self.cur = self.con.cursor()
    except (self._engine.Error, Exception):
        self.logger.exception('Failed to connect to database.')
        self.stop()
    self.logger.info("Connected to database.")