File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Performance Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Performance" Watch "Performance" New topic
Author

Performance

sudha swami
Ranch Hand

Joined: Apr 24, 2007
Posts: 177
Hi,
I have 2 tables A and B and they are linked with an ID. I need to update the address information in the table A based on the address information on Table B. There are 1500 records in the table A and in the table B there are 110000 records.

Method1

I can execute the stored procedure which in turn will update the table A address information from the table B's address information based on ID.

Method 2

In JAVA-JDBC code, retrieve each record from tableA and update the address info.

Which is the better approach performance wise?

Any help is appreciated.

Thanks
Sudha




Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26144
    
  66

Method one would perform better because it would be less database round trips and less data being sent around. Even faster would be to not duplicate the info which would avoid the need for part of this operation.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://jrebel.com/download
 
subject: Performance
 
Similar Threads
How to update or insert 1 million record to table B based on table A faster?
editing records
Performance tuning to select two whole tables for one-to-one mapping
Handling concurrent updates using JDBC
How do i implement this tricky requirement