refactored jdbc template and introduced call back