Move SQLException related helper methods into one place.: