Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 502
  • Last Modified:

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.
0
Javin007
Asked:
Javin007
  • 3
  • 2
1 Solution
 
CEHJCommented:
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

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now