Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to insert all the records except the failed one.

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,
I have a requirement in my application.
I have to insert about 1000 records into a database at a time.
So i am using batch update(to avoid performance issue).
Insertion will be done through stored procedure(MS SQL).
I will not set auto commit to false because,
out of 1000 records,if 10th record have wrong data,all the other records have to be inserted.Now the problem is,if insertion of 10th record failed,then all the first nine records are inserting succesfully.But from 10th to 1000th records are not getting inserted.
But what i want is,if 10th record is having wrong data, then except 10th record all the other records(total 999) should get inserted.Can any one suggest me the best way to do this using JDBC - CallableStatement?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
"Krish",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Let me recap: you started with an invalid display name 'D K' and then changed it to something valid. Now you have changed it back to something invalid. I'll close this thread and give you a chance to correct your display name.

Please note that we take display names very seriously.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic