my first post

Hi.. I am very new to JAVA.. I am now working on an tool development.. I want to know how I can export data from my database into an excel sheet and draw or plot a chart or graph for the same using javascripts and sql statements..