This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Export data from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Export data from database " Watch "Export data from database " New topic
Author

Export data from database

Maneesh Chauahn
Ranch Hand

Joined: Mar 06, 2006
Posts: 48
Hi All,
I am just writing a small application that takes the back up of the mysql database and write in a file in any format (most probably in the .txt format)

After taking the backup , i want to retrive the data from that file and export the data in the mysql database

If please someone suggest how to a write this application in a good and optimized way .
More over if some one suggest some open free source so that i will get good idea....

Thanks in advance ...

Maneesh Chauhan
sinasi susam
Ranch Hand

Joined: Jul 15, 2005
Posts: 67
Firstly i just did not understand your question very much...

1- you want to take a back up of mysql db and later you wanna insert all into db right?

2- My sql is storing db as files somewhere in its folders.
If your aim is only for back up then why don't you copy the files to somewhere and later copy the files to the mysql's folder that it uses from, as db? I mean manually...

As i said i had a couple questions, I was not sure about what you mentioned exactually.

If in any case you wanna store the datas to files (programatically) and later you wanna insert them into mysql again,

You can use serialization.

You create a javabean which will hold the data .
you persist data with that java bean into disc.
And you can retrieve it later too.

gl
[ September 23, 2006: Message edited by: sinasi susam ]
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
Take a look at the mysql client utilities mysqlhotcopy and mysqldump.
 
 
subject: Export data from database
 
Similar Threads
how to retrieve unicode data from mysql
plzzzzzzzz help me
Export data to Excel in Websphere Portals
How to export the PIF file format in WSAD 5.1.1
Export data to Microsoft Word