SCJP, SCWCD, SCBCD, SCJD (In progress)
SCJP, SCWCD, SCBCD, SCJD (In progress)
SCJP1.4, applying for SCJD [URLy1.2.1]
SCJP, SCJD, SCWCD, OCPJBCD
I think that SUN does this with puropose - I mean to omit the primary key.
IMHO the primary key depends on your Data layer logic.
You can calculate/generate one using the record information and your Data logic.
By example (I have the URLyBird) on my case it make sense that a record apears two times in the database - because a hotel can have more than one room with the same attributes,
so I chose not to throw any DuplicateKeyException.
SCJP1.4, applying for SCJD [URLy1.2.1]
Try to handle it even if it is not possible by our code to throw it keeping in mind that other db solutions can use it.
SCJP, SCJD, SCWCD, OCPJBCD
SCJP1.4, applying for SCJD [URLy1.2.1]
SCJP, SCJD, SCWCD, OCPJBCD
SCJP1.4, applying for SCJD [URLy1.2.1]
SCJP, SCJD, SCWCD, OCPJBCD
Now that I think about it, my assignment does not mention giving clients the ability to add, modify, or delete rooms. It just mentions that the client must be able to search and assign a customer to an available room.
SCJP, SCJD, SCWCD, OCPJBCD
SCJP1.4, applying for SCJD [URLy1.2.1]
Well, I presume that the DBAccess is the interface(don't forget in interface the exception is throw) so this code fails by compiling because the Duplicate... is a checkable exception.
I don't use it exactly in this way but I still use createRecord method on a instance of type DBMain(DBAccess in your case).The method is in a try catch block.
SCJP, SCJD, SCWCD, OCPJBCD
SCJP1.4, applying for SCJD [URLy1.2.1]
Maybe we should swich to priv emails? I have doubts it is interesting for anybody except us.
SCJP, SCJD, SCWCD, OCPJBCD
SCJP1.4, applying for SCJD [URLy1.2.1]