• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How to Lock Unique SQL Columns?

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys!!!

I would like that my JForum implementation don't allow that 2 users register themselves with the same email address.

I supposed that it's possible to create UNIQUE INDEX or something like that, but I'm not sure its the right way...

UNIQUE INDEX jforum_users_unique_index(user_email) :?

Tips?

[ ]'s
[originally posted on jforum.net by leandro_salvador]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best approach would be to check that on UserDAO.insertNew() / insertNewWithId().

I mean, do a query and check the email.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!