| | |
About Unique Constraint
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
•
•
Join Date: Sep 2008
Posts: 34
Reputation:
Solved Threads: 0
•
•
•
•
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.
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.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
![]() |
Similar Threads
- Database schema for a store (Database Design)
- Help Understanding Constraints (Database Design)
- can u please tel how to make a particular column unique (MS SQL)
- Constraint Help Please (Oracle)
- UNIQUE vs. DISTINCT (Database Design)
- Its really a problem on INSERT statement (MySQL)
- Question about SELECT statement (MySQL)
Other Threads in the Java Forum
- Previous Thread: BoxLayout question
- Next Thread: Help with Flight management system
| Thread Tools | Search this Thread |
-xlint add android api applet application array arrays automation bi binary blackberry bluetooth chat class classes client code compile compiler component converter database digit eclipse equation error event exception fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying page pearl print problem program programming project qt recursion scanner screen scrollbar server set size sms sort spamblocker sql string superclass swing system thread threads time tree variablebinding windows xor






