Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

DuplicateKeyException  RSS feed

 
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!