• 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
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Selecting which user is login

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am making one application in which 3 users are there. I am confused at the time login how can i know that which user is login and which page I have to call and also tell me primary key and foreign key of table. my users are: STUDENT,FACULTY,ADMIN if possible than explain with some example.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we tell you what the primary and foreign keys of your table are?

At login time the person logs in giving (presumably) a username and password--that's how you know who's logging in. They tell you.

Are your *users* "STUDENT", "FACULTY", and "ADMIN", or are those the *types* of users?
 
Ahesanali Khanusiya
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes they are types of user...one table of user in which userid-pk and usertype fields another table login in which loginid-pk,username,password and userid-fk third is register in which sign up detail and loginid-fk
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I'm not sure what the question is then.
 
Ranch Hand
Posts: 282
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should have a "users" table in the database with a "role" column that stores whether they are a student, faculty, or admin. Then, when they login, you use the username and password they entered to find the row that represents the user in the table. Use the value of the "role" column to determine what kind of user they are.
 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if I understood you right it would be like:


I know the code is ugly but it is just to give you an idea.
 
it's a teeny, tiny, wafer thin ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!