Java - Fastest way to copy resultset?

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.
LVL 4
Javin007Asked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
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
 
Javin007Author Commented:
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
 
CEHJCommented:
Well that's how cursors work. Are you talking about Access by any chance?
0
 
Javin007Author Commented:
Sure enough, using the RDBMS's "INSERT INTO" statement I was able to insert to an external database, and it was quite fast.
0
 
CEHJCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.