This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B & S App Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B & S App" Watch "B & S App" New topic
Author

B & S App

Eamonn O'Connell
Greenhorn

Joined: Aug 25, 2006
Posts: 11
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

Joined: Sep 11, 2005
Posts: 6
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

Joined: Apr 21, 2006
Posts: 1847
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.


42
Jeremy Botha
Ranch Hand

Joined: Feb 16, 2005
Posts: 125
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


McFinnigan? Never heard of him. Nobody here but us chickens...<br /> <br />SCJP for Java 1.4<br />SCJD for Java 5.0
Eamonn O'Connell
Greenhorn

Joined: Aug 25, 2006
Posts: 11
Cheers for the advice. Documenting it sounds like the way to go...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: B & S App
 
Similar Threads
Fetching from the session
Read keypress event in core java?
Help pls -Urgent(logic:iterate)
I need a Hash function?
Single table two column dependency query