Cleaned up SQL class. Now gives proper error when connection times out.