Handle SQLExceptions better