• Post Reply Bookmark Topic Watch Topic
  • New Topic

Best way to insert 10000 rows in JDBC

 
Senthil Kumar Sekar
Ranch Hand
Posts: 45
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Can anyone tel me the best way to perform 10000 rows insert or bulk insert in JDBC?
Say,I have a file with 10k records which i need to insert to DB after manipulation.

Thanks.

Regards
Senthil Kumar Sekar
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35977
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two alternatives:
1) prepared statement batch updates (in smaller groups)
2) writing to a flat file and importing at command line

I'd probably go with #1 because I would want to batch the manipulation of the 10K records anyway.
 
xsunil kumar
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Batch update for this
 
chris webster
Bartender
Posts: 2407
33
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're using Oracle and can provide your data in a CSV file, then using Oracle external tables is probably the quickest way to do this.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!