This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes How do you copy data from one database to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How do you copy data from one database to another" Watch "How do you copy data from one database to another" New topic
Author

How do you copy data from one database to another

ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
I have a situation where I need to copy 300,000 rows of data from a table on a database to a similar table on another database .
Could someone suggest a performance oriented JDBC solution to achieve this ?


SCJP, SCJD, SCWCD, SCBCD, SCEA
Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
Does it have to be through JDBC?
If not, you could try the export and import functions of the DBMS(es) in question.
Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
Using a JDBC solution, remember to turn auto-commit off first.
conn.setAutoCommit(false);
Then when you're done copying the rows, remember to commit.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do you copy data from one database to another