943,777 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 434
  • Java RSS
Feb 9th, 2009
0

About Unique Constraint

Expand Post »
Hello,
I want to check uniqueness of id at the time of entry only.And I want to give message to the user at that time only.How to do this?
Similar Threads
Reputation Points: 9
Solved Threads: 0
Light Poster
srs_grp is offline Offline
34 posts
since Sep 2008
Feb 9th, 2009
0

Re: About Unique Constraint

Either you generate the Id and assign it to the user yourself using an autoincrement or a UUID feature, but if you want the user to select his own ID you will have to perform a check in your records (database or files) to check if the ID has already been chosen by someone else.
Featured Poster
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
stephen84s is offline Offline
1,316 posts
since Jul 2007
Feb 9th, 2009
0

Re: About Unique Constraint

Click to Expand / Collapse  Quote originally posted by stephen84s ...
Either you generate the Id and assign it to the user yourself using an autoincrement or a UUID feature, but if you want the user to select his own ID you will have to perform a check in your records (database or files) to check if the ID has already been chosen by someone else.

yes.. but the problem is where should I perform this check,so that I can immediately inform user abt constraint violation.
Reputation Points: 9
Solved Threads: 0
Light Poster
srs_grp is offline Offline
34 posts
since Sep 2008
Feb 9th, 2009
0

Re: About Unique Constraint

That depends, what are you working on right now, what type of application is it ? A web page, Swing form ? You want specific answers but you haven't yet given details specific to your application.
Featured Poster
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
stephen84s is offline Offline
1,316 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: BoxLayout question
Next Thread in Java Forum Timeline: Help with Flight management system





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC