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

  • Home
  • SEARCH
  • 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 6832591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:52:37+00:00 2026-05-26T22:52:37+00:00

I want to encrypt/hide my connection string in my database.java class. I allready searched

  • 0

I want to encrypt/hide my connection string in my database.java class. I allready searched the internet but I didn’t find anything usefull, maybe I searched the wrong keywords? Here is my current code.

conn = DriverManager.getConnection("jdbc:mysql://database/db", "username", "password");

How can I hide the username and password? So only my application can see it? And you can’t see it when you extract the jar?

Thanks.

  • 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-26T22:52:38+00:00Added an answer on May 26, 2026 at 10:52 pm

    Encrypt the connection string is not what you need! I suppose you need a better way to store your password. For this you should store passwords, in a separate file that the application reads when it starts. That is the only real way to prevent the password from leaking as a result of decompilation.

    See this answer : From a similar question

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

Sidebar

Related Questions

I want to encrypt a string, but the standard Java libraries are too complicated
i want to encrypt string in java and decrypt the same string in C#
I want to encrypt the password in connection string. When I make a connection
I want to encrypt a string using AES with my own key. But I'm
I want to encrypt a string and embed it in a URL, so I
I want to know if my connection string is encrypted or not. I don't
we want to encrypt some attributes of our entity, but still be able to
I want to encrypt a filename but ensure that the encrypted filename doesn't contain
I want to encrypt sql server database files (2008) I want to make a
I want to encrypt database because confidential data is being stored. I use mongodb

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.