Hi there, the schema for my database file looks like this:
subcontractor name, location, specialties, size, rate, owner
My question is, do folks generally use the subcontractor name as a primary key? I've chosen not to do this (you might have subcontractors with the same name in different locations), and I use the record's position in the file (ie. its number) as the primary key.
Problem is, my interface demands this method:
Seeing as I don't pass the primary key into the
String [] data array above, (my record is assigned a key by its location in the file) how can I check for a DuplicateKeyException? It's pretty much impossible to get duplicate keys the way I'm doing things.
Perhaps I should interpret this as "Duplicate Record"?
If so, what's the best way to check for dupes? I would assume it's to keep an array of the hashes of each record and check against that, rather than digging through the database file.
Any suggestions?