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 7005731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:23:17+00:00 2026-05-27T21:23:17+00:00

On my program, I prompt the user for a username and password, and I

  • 0

On my program, I prompt the user for a username and password, and I use passwordField to keep people looking at the screen from seeing it. Now when I use the password to connect to the database what should I use?

java.sql.Connection con = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/database", username.getText(), passwordField.getText());

1) .getText() works but its deprecated

2) .getPassword().toString() which maybe the same as .getText() but just longer Otherway?

I do not think that any VITAL information maybe lost using my program, but still would like to do things the right way (or understand why). I thought MD5 was the best way to go incase people sniff the communication.

  • 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-05-27T21:23:18+00:00Added an answer on May 27, 2026 at 9:23 pm

    Two things,

    1. Now a days SHA2xx is considered more secured algorithm
    2. You don’t have to worry about the encryption/hashing in this code. Most probably your driver will take care of it by internally hashing your db password.

    When you are creating a website, or anything that requires password to go through the wire, that’s when you should try hashing(with salt) it and storing it hashed in the database.

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

Sidebar

Related Questions

I was wondering if it is possible for a program to prompt the user
What I need to do is to prompt the user with a username and
How do I get my program to prompt the user for different choices until
This is a program that is supposed to prompt user for hours worked and
This program should prompt the user to update their stream; instead it does nothing
This is the question. write a program that prompts the user to input five
I have a c program which I can launch at command prompt. Is it
Program followed by output. Someone please explain to me why 10,000,000 milliseconds from Jan
What program can I use to decompile a class file? Will I actually get
I am trying to have a loop continue to prompt the user for an

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.