My problem is as I stated above. Couldn't find any solution worked for me nor the existing ones weren't specific enough to fit in my situation. Here's the detailed explanation:
I am using the Eclipse Indigo Java EE IDE on Windows 8 machine, trying to learn JSP and the web services environment by the tutorial "Up and Running with Java Applications" by Todd Perkins, using the built-in Tomcat v7 server in eclipse and mysql & apache from Xampp. I've taken the baby steps as instructed and saw it working in the built-in browser in eclipse. But when it comes to execute the following line
Connection conn = null;
Statement stmt = null;
ResultSet result = null;
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/world","root","1234");
out.println("Connected to database.");
out.println("Error connecting database");
It looks to me like it'd doing exactly what you're telling it to do.
It's printing the xml tag, and then inside that tag, either an error message, or a successful message, in the same format you specified, what exactly are you expecting it to do?
If you're expecting the output that just has the word, maybe it'd be because your browser isn't displaying XML the same way as the instructors, could you post the entirety of your xml so we can see it?