If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How to export a mysql database from a java application?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-09-04, 14:17
digital_storm digital_storm is offline
Registered User
 
Join Date: Dec 2003
Posts: 28
How to export a mysql database from a java application?

Hello!

Is there a way to export a database and all its tables from a java application?

If yes, how does the syntax looks like?

Regards // D_S
Reply With Quote
  #2 (permalink)  
Old 03-10-04, 05:50
omiossec omiossec is offline
Registered User
 
Join Date: Jan 2003
Location: Paris, France
Posts: 320
You can use SELECT OUTFILE syntaxe

SELECT col INTO OUTFILE "/pathto/result.text"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "\n"
FROM table WHERE ....;
__________________
Olivier Miossec
--
http://www.lasso-developpeur.net/
--
Reply With Quote
  #3 (permalink)  
Old 03-10-04, 07:03
digital_storm digital_storm is offline
Registered User
 
Join Date: Dec 2003
Posts: 28
Hello,

Thank you for your answer...but.

I'm a newbie of mysql but your syntax doesn't I select every column, and saving the information to a textfile, or? That means I have to read all my tables and save the information to different textfiles, or am I wrong?

I want to package all my tables ifrom my database " division" and export it like a *.SQL-file like I do from the "c:/mysql/bin-promt" where I export my hole database:

mysqldump -u username -ppassword database_name > FILE.sql

Regards // D_S
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On