try to refactor jdbc repitition