Refactor jdbc handling portion inside service_handler