This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes populate all data from old database to a new one. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "populate all data from old database to a new one." Watch "populate all data from old database to a new one." New topic
Author

populate all data from old database to a new one.

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Hi all,

here is the deal: I have installed a mySql db on my client server. He has asked for some improvments and that required me to add some new tables and columns to existing tables.

Question: is there any way to take all the data in his db and populate it into the new db?

Thanks
peter
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1138
    
    1

Peter,
I don't know mySQL, but perhaps it has some sort of INSERT...SELECT... statement? Most databases do. Alternatively, most databases have a utility to dump table data to some flat file, and another utility to load data into a table from a flat file. But then again, being mySQL, maybe it doesn't have any of those things. (You get what you pay for! )

Good Luck,
Avi.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

man mysqldump

http://dev.mysql.com/doc/mysql/en/mysqldump.html
[ April 12, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Most databases do. Alternatively, most databases have a utility to dump table data to some flat file, and another utility to load data into a table from a flat file.

right but this produces the create and delete. the only thing i am intreseted is in INSERT

so if i have an old db it will produce insert statments.

any idea what the dump command should be?
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: populate all data from old database to a new one.
 
It's not a secret anymore!