sqlcode logic in a separate class