| | |
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 |
2dgraphics account android api apple applet application array arrays automation banking binary binarytree bluetooth chat chatprogramusingobjects class classes client code component data database derby design draw eclipse encryption error event exception fractal game givemetehcodez graphics gui html ide if_statement image inheritance input integer interface j2me java javadesktopapplications javaprojects jlabel jni jpanel jtextfield julia linux list loop map method methods midlethttpconnection mobile monitoring netbeans newbie nullpointerexception open-source oracle print printing problem program programming project property recursion reference ria scanner screen search server set size sms sort sourcelabs splash sql static stop string swing testautomation threads time tree ui unicode validation windows






