This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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.