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.

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.

commented: Excellent suggestion - keep it simple! +15
commented: Cheap, Simple, and Valuable answer. +11
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.