If you have downloaded JExcelApi then there are whole set of demos included, try working your way through the write one - it is comprehensive. Be aware that JExcelApi does not support xslx files i.e. the latest version of excel. If you simply want to get data from a result set into excel then create a .csv file, make the first row your column headers and and each other row the data; excel will open it drectly and convert it on the fly. For example a result with two rows, each row has three columns - age, town, country . Create a csv file that looks something like the following from the data:
age, town, country
42, london, uk
19, glasgow, scotland