Re: Information in SQLException
- From: hombre <hombre67@xxxxxx>
- Date: Thu, 24 Nov 2005 20:42:17 +0100
Bjorn Abelli schrieb:
"hombre" wrote...
I am using JDBC to connect to a MySQL database. The database has a table 'customer' with a primary key that is automatically generated by my program. There is another unique key (customerID) which has to be entered by the user.
I don't understand why you've chosen to use more than one unique key, as it sound to me as the latter would suffice...
I want that the primary key never changes and has no meaning except to uniquely identify the customer. It is not visible to the user. Changing a primary key is difficult, because it would be necessary to find all entities that have dependencies on the primary key.
But I also want to have a customer-ID that is visible to the user. The format of the customer-ID can be choosen by the user (suppose that a user wants to import existing customers that have already a customer-ID assigned). The only resctriction is that the customer-ID is unique. When the users decides at a later time to change the customer-ID (e.g. appending the birthdate), then this can be done very easy.
Hombre .
- References:
- Information in SQLException
- From: hombre
- Re: Information in SQLException
- From: Bjorn Abelli
- Information in SQLException
- Prev by Date: Joining every row from 1 table to every row from another
- Next by Date: Re: Information in SQLException
- Previous by thread: Re: Information in SQLException
- Next by thread: OJB Problem
- Index(es):