Solved

Java - Fastest way to copy resultset?

Posted on 2013-10-25
5
442 Views
Last Modified: 2013-10-25
Pretty straightforward:

I have two different connections to two different databases, and I need to find the absolute fastest way to move the data from a table in connection 1 to an identical table in connection 2.  

I'm hoping I don't have to go row-by-row with a bajillion "UPDATE" calls to do this.
0
Comment
Question by:Javin007
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 39600694
It's often easier to use the tools of the rdbms to do this but failing that you could use one update statement (PreparedStatement) in batch mode
0
 
LVL 4

Author Comment

by:Javin007
ID: 39600772
But wouldn't the prepared statement require me to loop through the result set record-by-record still?  I was hoping for some sort of more direct "bulk" method.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39600837
Well that's how cursors work. Are you talking about Access by any chance?
0
 
LVL 4

Author Closing Comment

by:Javin007
ID: 39601047
Sure enough, using the RDBMS's "INSERT INTO" statement I was able to insert to an external database, and it was quite fast.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39601079
:)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now