Basically, What I deduct from DuplicateKeyException is that you can not create a record which already exist. This means that before creating the record you have to search to find a record with the criteria passed to createRecord() method. If you find a match then it means that you already have that record so
you should throw DulplicateKeyException.
From project context from what I see in provided sample database file by Sun you can not have the business name in the same city twice record. But you can have the same business name in different cities record. So you can limit your search cirteria only to the first field, i.e. Business Name and Loction. If you find a match then you should throw DuplicateKeyException.