1

Hi I have client java program that execute with jar file.

However that client program contain JDBC with user name and password.

I think it's not really good for security because everyone can decompile jar file.

Which one is best way to make JDBC connection string with secured module.

Program is built by Java version 1.6. Database is Sql-server.

Thank you!

2 Answers 2

1

It is common practice to have user/password info contained within the source. If you are worried about people decompiling the code, you need to obfuscate the jar file.

Pro Guard is a good tool for this.

Here is another article from Stack Overflow that covers some of the best tools in detail: Best tool for jar or class obfuscation without need of writing any additional config file

Sign up to request clarification or add additional context in comments.

Comments

0

First what came to mind is usage of input dialog

String userName = JOptionPane.showInputDialog("Enter DB username");
String password = JOptionPane.showInputDialog("Enter DB password");
String connectionURL = "jdbc:sqlserver://localhost;user=" + userName + ";password=" + password + ";";

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.