Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bulk copying of objects from one db to another

 
Stuart Rogers
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings,

Suppose I have two databases "Foo" and "FooBar" on separate servers. "Foo" has a table "Foo.States" and "FooBar has a corresponding "FooBar.StatesOfUnion". The structure of the two tables is identical. "FooBar" is a permanent MySQL database living on a server on the 'net, while "Foo" is a in-memory HSQL database.

When a user fires up the Java app "Foo" is instantiated but empty. Must I do some sort of for-loop creating a new Foo.States object from each FooBar.StatesOfUnion object, or is there a better/smarter/faster/easier way?

TIA,

Still-learning Stuart
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the sort of thing usually not done in code but by dedicated tools called ETL - Extract, Transform, Load. While lots of such 3rd party tools exist, most databases have their own import/export facilities; that's where I'd start looking.
 
Stuart Rogers
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, for now I'll use the for-loop copy-object method as I've got that working. Don't dare introducing another new link into my Java/Hibernate/Spring/Maven/Eclipse toolchain lest it wrap around my neck and stranglulize me.

Thanks for your reply!

Still-learning Stuart
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic