This is a code smell to me, the worker class should not have to deal with database connection, it's mixing concers, no?