• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

transfer data from one DB to another DB ?

 
kri shan
Ranch Hand
Posts: 1462
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to transfer data from one DB to another DB using JDBC?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While it wouldn't be hard to write JDBC code that does a SELECT in one DB, and then an INSERT into the other DB, that's not the best approach. Just about all DBs have their own facilities for bulk-exporting and bulk-importing data; that area is called ETL (extract, transform, load) - check the documentation of the involved DBs for what they support.
 
kri shan
Ranch Hand
Posts: 1462
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess ETL is third party product like Informatica. It is not part of the DB. I want the option that's part of the DB or thru JDBC.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, ETL is a tool category; check its Wikipedia page if you're unsure about the term. There are certainly 3rd party products for this, but:
Just about all DBs have their own facilities for bulk-exporting and bulk-importing data ... check the documentation of the involved DBs for what they support.
 
april henry
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can try to use the following code:


select 'insert into tb_08 select '+rtrim(id) +','''+name+'''' from tb_08
/*
insert into tb_08 select 1,'b'
insert into tb_08 select 2,'b2'
*/

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic