SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/
Life is the biggest school
42
SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/
Life is the biggest school
there is no way for the client to know if the update operation succeeded or not.
Why do the create method throw a DuplicateKeyException???
SCJP, SCWCD, SCBCD, SCJD (In progress)
Whatever combination of feilds the primary key was,the question is:Why dont the update method throw a DuplicateKeyException.
SCJP 1.4,<br />SCJD (URLyBird 1.2.1, JDK 5.0)
SCJP , SCJD. (IBM 142 in progress).
SCJP<br />SCJD (in progress)
Originally posted by Rudolph Jen:
>sorry - might be wrong. The method create throws DuplicateKeyException....
I agree here! I admit that the javadoc for the provided interface is a little bit unspecified about that Exception, but the name is clear.
Actually it isn't that hard:
1. Search for a record matching the fields of the record you would like to add
2. If you get some => throw new DuplicateKeyException()
Regards,
R
----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
Consider Paul's rocket mass heater. |