This code requires the use of the free library java CSV and MyCsvWriter.
. . . MyCsvWriter csvWriter = new MyCsvWriter("File Name.csv"); try { csvWriter.writeColumnNames(rs); csvWriter.writeRecords(rs); csvWriter.flush(); csvWriter.close(); } catch (SQLException e) { System.out.println("Oops-> " + e.getMessage()); } catch (IOException e) { System.out.println("Oops-> " + e.getMessage()); } . . . |