File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B & S App

 
Eamonn O'Connell
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Folks,

This could be my first post here, but I've read many. Very Helpful!

On to the question...

Does any one know, or can anyone guess what the DuplicateKeyException thrown by the create method of the supplied interface is all about?

I just use the position of the record in the file as the key. Are we to use something else? Like the name as the key?
 
Kiev Gama
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was not clear to me also, since in my assignment there was no rule defined for 'primary key'.

If you are uncertain about anything, write that down on your choices document justifying why and what you did.

That's what I did. I can't tell if they took away points from my grade because of that, but I passed


Regards,

Kiev
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is (in my assignment at least) no key defined so you can never get a DuplicateKeyException.

It is however conceivable that another database format might have a defined key, so the interface supports the option to throw that exception.
That's often the case with interfaces you get from 3rd parties, they're more generic than you have a need for because you're not the only one coding against them.
 
Jeremy Botha
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I defined my own composite primary key from the data in my db file, so for me the DuplicateKeyException was actually usable. I realise this is technically outside the scope of the project; I just have a pet hatred for duplicate data

Jeremy
 
Eamonn O'Connell
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers for the advice. Documenting it sounds like the way to go...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic