• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to check if a given username already exists?

 
Chandana Garlapati
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to check if a given username already exists which contains in database table mysql using result set??

can anyone please help me on this??

Thanks in advance
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Chandana Garlapati,

I didn't get your question completely. Do you want to check that if given user name already exists in database? In that case, all you'll need is a select count query.

I hope this helps.
 
Chandana Garlapati
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply

i need to check if the given username(user entered in the browser) in the database table exists or not??
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(As this is a database/JDBC related question, I shall move it to a more appropriate forum.)

Anayonkar is right, the select count query is usually enough. If you don't know what that means, an SQL Tutorial might help you.

However, if you tell us why you need to do so, we might be able to help you more. For example, if you're doing this as part of creating a new user, more things have to be handled so that the code does not fail in multiuser environments.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic