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

simplest way to achieve this

 
Sherif Shehab
Ranch Hand
Posts: 487
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all ,

I'm new to hibernate , i wanna to make a program with java using hibernate to read some data from specific table in db then do some processing on this data then insert it in another Db , what is the simplest design to achieve this ?
PS : this is a console based program ...
 
Javid Jamae
Author
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are the database schemas the same across both DBs? Are the objects/mappings the same across both DBs? If everything is the same, and you're just copying, then you could use two different session factories on top of the same objects/mappings. That being said, you might find it easier to do this sort of copying using database utilities if both databases are the same.

If the schemas are different, then you'll need different objects/mappings. You'll still need two different session factories, one pointing to each set of objects/mapping.
 
Sherif Shehab
Ranch Hand
Posts: 487
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Javid Jamae wrote:Are the database schemas the same across both DBs? Are the objects/mappings the same across both DBs? If everything is the same, and you're just copying, then you could use two different session factories on top of the same objects/mappings. That being said, you might find it easier to do this sort of copying using database utilities if both databases are the same.

If the schemas are different, then you'll need different objects/mappings. You'll still need two different session factories, one pointing to each set of objects/mapping.


ya the db schemas are the same . what Db utilities do you recommend to do this ?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All databases come with bulk loading tools designed to move data from one schema to another, possibly performing some processing along the way. These tend to be capable of using database features not available to a normal JDBC applciation to speed up performance and also don't require the configuring of a third party product such as Hibernate. Check your database documentation for the topic "bulk loading" or "import/export".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic