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.
You can create a regular csv file with java.io.file package components. Or you can go after Apache POI and JExcelApi for Microsoft Excel file format. You may find lots of examples in the specified API documentation pages.
Assuming that you have to do it with your own code. Other wise you can export data with any pl/sql editor by hand.