This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes How to insert 100’s of records in to database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to insert 100’s of records in to database?" Watch "How to insert 100’s of records in to database?" New topic
Author

How to insert 100’s of records in to database?

cherry hal
Greenhorn

Joined: May 06, 2012
Posts: 10
please tell me with sample code....How to insert 100’s of records in to database fromB java with out going multiple hits to DB?
Bill Clar
Ranch Hand

Joined: Sep 21, 2006
Posts: 150

When you say 'multiple hits', are you referring to DB connections?
Ishant Agarwal
Greenhorn

Joined: Sep 09, 2011
Posts: 22
You can use a batch execution...

For this you can use below code:-


[Rob]Removed unrelated link[/Rob]
 
Consider Paul's rocket mass heater.
 
subject: How to insert 100’s of records in to database?
 
Similar Threads
pre-compile and prepared statement
addBatch - help/ideas?
Inserting multiple record in DB using for loop
JDBC DB2 database hits
Serializability and recoverability