I want to transfer data from mysql database to an msexcel sheet...

Is it possible with java. how?

Bring your data from mysql db and write to file..

There are 2 ways for writing Excel :

1. Basic Level
Writing CSV(Commma Separated Values) format.
Write your data in simple java file using commas(,) & append extension ".csv" to file name.
eg. file name : companies.csv
data :
1,2,3,4,5
a,b,c,d,e
microsoft,ibm,sun,oracle,apple

This will automatically create excel format file.

2. High Level
Using Apache POI (http://poi.apache.org/)
This is high end Java Library for writing Microsoft Office format files (Word, Excel, Powerpoint etc.)
You can use this library. You will need to read help on the respective site. It supports all types of formatting in excel that one will need.

Edited 7 Years Ago by sawant_nitesh: n/a

Bring your data from mysql db and write to file..

There are 2 ways for writing Excel :

1. Basic Level
Writing CSV(Commma Separated Values) format.
Write your data in simple java file using commas(,) & append extension ".csv" to file name.
eg. file name : companies.csv
data :
1,2,3,4,5
a,b,c,d,e
microsoft,ibm,sun,oracle,apple

This will automatically create excel format file.

2. High Level
Using Apache POI (http://poi.apache.org/)
This is high end Java Library for writing Microsoft Office format files (Word, Excel, Powerpoint etc.)
You can use this library. You will need to read help on the respective site. It supports all types of formatting in excel that one will need.

Thaknx a lot.. i'll try & i'l b in touch...

many front ends (such as phpmyadmin) will let you export a table to a csv file, which can be opened directly in excel.

many front ends (such as phpmyadmin) will let you export a table to a csv file, which can be opened directly in excel.

:icon_lol:

This article has been dead for over six months. Start a new discussion instead.