Ceate CSV File through java.
String sql2="SELECT * FROM inventory into outfile 'h:/inventory.csv' FIELDS TERMINATED BY ','\n" +
"ENCLOSED BY '\"'\n" +
"LINES TERMINATED BY '\\n';";
com.mysql.jdbc.PreparedStatement pst1=(com.mysql.jdbc.PreparedStatement) con.prepareStatement(sql2);
pst1.executeQuery();
pst1.close();
JOptionPane.showMessageDialog(null,"Go To H-Drive For CSV File");
Desktop.getDesktop().open(new File("h://inventory.csv"));