Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Duplicate Key Exception

 
ford Darcy Jr
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a column which is Unique, when I try to enter duplicate values, it gives me duplicate key exception. How to catch this exception.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to Java in General (beginner)
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please elaborate? Where are you storing this unique "column"? Where are you "entering" it? What code causes the exception?

In general, you use a try...catch() clause to catch an exception:

I suggest you find a beginning Java text. Any text worth its salt will have at least an introduction to exception handling that will provide more details than I have given here. Alternatively, you chould check out the exception handling section in the Java Tutorial (see the link in my sig).

Layne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic