java login/logout on localhost -


this desktop application uses jdbc:mysql://localhost/ database.
long story short, i`m trying do:


  1. ask credentials (username/password).
  2. compare mysql database match (true/false).
  3. if true → load workspace, implements data mysql.
  4. if false → keep asking valid credentials.

as of now, i`m thinking of using cardlayout approach.
schema simple:

  1. if true → switch workspace_card.
    • set mysql table field (user_status) 1 (meaning online).
  2. logout → switch login_card.
    • set mysql table field (user_status) 0 (meaning offline).

so, question is:

  • may cardlayout considered approach when comes low level security type of applications?
  • what accurate schema/method use in javaworld achieve above tasks/results?

i guess stoting user online/offline status in database , manahe through application in bad approach. in cases, such of application/database process shutdown, force shutdown , others, logout logic may not executed, , user_status left online.

in typical java web application use web session (which 1 storing credentials) , jdbc pool (like bonecp or c3p0). have desktop application, may use jdbc pool , need make kind of session storing user status/credentials


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -