Combine beans and water in a large pot and bring to a boil. Remove from heat and let stand 1 hour. Return to medium heat and add olive oil, ham, onion, celery, garlic, salt, and pepper. Cook 3 hours. Then add spaghetti and simmer 10 to 15 minutes until tender. Serve in soup bowl and top with generous spoonfuls of Parmesan cheese. Serves 4 to 6.