|
|
Re: Excel File download using Java
|
Posted: Feb 17, 2004 12:37 AM
|
|
You can Read the daat from Oracle using JDBC in java and then crea the Excel from the Oracel data using the Java Implementation of EXCEL API.
here is the sample java code to creat the EXCEL File...
import java.io.File; import java.util.Date; import jxl.*; import jxl.write.*; /* look for more API info on web. */
class Java_Excel1 { public static void main(String arg[]) { WritableWorkbook workbook = Workbook.createWorkbook(new File("output.xls")); WritableSheet sheet = workbook.createSheet("First Sheet", 0); Label label = new Label(0, 2, "A label record byViswa"); sheet.addCell(label); Number number = new Number(3, 4, 3.1459); sheet.addCell(number); // All sheets and cells added. Now write out the workbook workbook.write(); workbook.close(); }
Thanks Viswa IBM, india bgviswan@in.ibm.com -------------------------
|
|