File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B & S App" Watch "B & S App" New topic

B & S App

Eamonn O'Connell

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

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


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.

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


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

Joined: Aug 25, 2006
Posts: 11
Cheers for the advice. Documenting it sounds like the way to go...
I agree. Here's the link:
subject: B & S App
It's not a secret anymore!