0

Hi, I have built an application using java programming and I want to write MySQL table data to excel sheet by using Apache's POI libraries and MySQL connector in java. I have explored many mobile development blogs for my previous query on Android Programming & get a satisfactory solution. I hope some of the tech experts in this community can help to figure out my issue on java programming.

2
Contributors
1
Reply
15
Views
11 Months
Discussion Span
Last Post by Tarek_2
2

Hi,

In this particular case, personally, I don't use any APIs, I simply generate a csv file which can be opened directy in Excel like any other Excel file.
CSV format is a text format wich means a simple FileWriter can be used without any external APIs.
The generation takes only one loop, the simpliest one whith a :

while(resultSet.next()){
        String line = resultSet.getXXX(1) + "\t" + resultSet.getXXX(2) + "\t" + ...;
        bufferedWriter.write(line);
        bufferedWriter.newLine();
 }

I will other answers about apache's API, I have never used it so I think I will learn something useful.

Edited by Tarek_2

Votes + Comments
Cheap, Simple, and Valuable answer.
Excellent suggestion - keep it simple!
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.