This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to control the User from inserting the same EIN(unique no. in db) and Primary Key violation?

 
Vinod Vinu
Ranch Hand
Posts: 217
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to use the error handling properly so that i can avoid the primary key violation ?

Thanks in advance
 
Ranveer K Kumar
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vinod Vijay wrote:How to use the error handling properly so that i can avoid the primary key violation ?

Thanks in advance


1) You can set primary key as database/server side. which can be auto generated so user can not enter the duplicate value. (can be display on the form as read only field)
2) You can check the user entered value on server for duplication before inserting the record..
 
Sagar Rohankar
Ranch Hand
Posts: 2905
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is EIN ? Is it some kind of ID ? then ID is supposed to be created by DB.
If its anything other attribute than ID, then first you need to find out any row with that same EIN, if not present, enter one.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic