This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Alvin, I've used JFreeChart (which cewolf) is based on. Both are frameworks for creating charts in Java. You get the data from the database through JDBC, just like you would for any web application. After storing that data somewhere appropriate (like in the HttpRequest), you call the framework to draw the chart.
If you have more questions about JDBC, post them here. If this question is more about cewolf, let me know and we can move this to the JSP forum.