Two Laptop Bag*
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
Similar Threads
SQL Query
Copying of column
copy talble using jdbc
Moving columns between tables
Copying data from one DB to another