Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jdbc statement execution

Status
Not open for further replies.

sroberts82

Programmer
Oct 11, 2005
36
US
Hi,
Im writing a program that performs approximately 50,000 inserts into a DB using jdbc. It is really slow however. How can I speed it up? I tried using batch queries but didnt speed up at all. What is the optimum size of the batch? Are there any other ways to speed things up? Thanks in advance
Ste
 
Most db's come with a tool for doing bulk data inserts - I would forget JDBC, and use that tool.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Well 50k inserts don't sound much to me. Are you using prepared statements?
How long does it need?
Did you do some profiling, to see where the time is spend?
Sometimes the network is the bottleneck.
Are there many users connected to the database? May you perform your inserts outside buisiness-hours?

seeking a job as java-programmer in Berlin:
 
Its taking about 45 mins to do 196,000 inserts. Does that sound reasonable or could I speed things up much? Network isnt really very congested
 
Thats 72 transactions a second .... sounds alright to me !!!

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top