Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DuplicateKeyException

 
Ramy Atef
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am puzzeled about this exception and when should it be thrown, as it is not clear from the db file what it the primary Key of the file. Can anyone help.
 
Jeff Powell
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was also puzzled by that problem. I decided since they did not provide specific fields for the primary key, not to have one. I used the whole row of data as my primary key. I then documented my decision in the choices document. This was my solution but my assignment didn't allow the user to create rows of data so I never had to put it to the test.

Hope that help,
Jeff
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!