exception that catches the SQL exception