Hi Friedns,
I am working on a j2ee project. How to export MySql table data to a word document......or to a rtf file.......... Urgent.........give me immediate reply...... send to :
vsrinivas8@yahoo.com
Hi
This is the query to export and import file from and to Mysql table
exporting
Statement stmt = con.createStatement();
String tablename = "employee";
// path of the file
String empfilename = "F:\\\\newfolder\\\\empfile.txt";
File empfile = new File(empfilename);
if (rmfile.exists() == true)
rmfile.delete();
stmt.execute("SELECT * INTO OUTFILE \"" + empfilename
+ "\" FROM " + tablename);
Importing
String query = "LOAD DATA INFILE \"" + empfilename + "\" INTO TABLE " + tablename;
I hope this will help you