By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,737 Members | 1,971 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,737 IT Pros & Developers. It's quick & easy.

How export data from MySql table to a Word document in java

P: 2
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
Jan 17 '07 #1
Share this Question
Share on Google+
3 Replies


P: 2
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
Jan 17 '07 #2

10K+
P: 13,264
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
this should help you.
Jan 17 '07 #3

P: 35
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
Jan 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.