Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7758735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:26:25+00:00 2026-06-01T13:26:25+00:00

I need to make a java program with a security and a login system

  • 0

I need to make a java program with a security and a login system for a project at school

I was thinking of using a enum for the security role in java with a security level:

public enum Role {

lECTOR(0), COORDINATOR(1), ADMINISTRATOR(2);

private int securityLevel;

Role(int securityLevel) {
    this.securityLevel = securityLevel;
}

public int returnSecurityLevel() {
    return securityLevel;
}    

In mysql I’m thinking of making two tables

table users with a userid, username, password and security_id

roles with a security_id, rolename  this table I would link to the enum

depending on the securitylevel I would then say what a specific user can or can’t do.

Is this a good way to work or not, any suggestions are more then welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:26:28+00:00Added an answer on June 1, 2026 at 1:26 pm

    You should consider if you really need a separate table for the enum. Maybe just have a column for it in the user table.

    The only reason to keep it a separate table is if a user can have multiple roles.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to make a game in Java for a project. What I'm trying
Situation: I need to make an imap client (using java mail api) that if,
I have a project in Java and I need to make a code listing
I need to make a simple refresh button for a gui java program I
i need to make a cron job to run a java program every 40
I need to make a small test program in java which has to communicate
I don't know Java, only C#, and I need to make a simple program
I need to create a java program which should go to a website's login
Does anyone knows how to generate QR code using Java program? I need to
Im developing java program ,and I need to make it start working at each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.