Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Encrypt JDBC connection string

843859Feb 19 2007 — edited Jul 5 2007
Hi,
I've read many posts on password encryption, but all are regarding to the user password encryption;
but I think the first is to encrypt the database connection string.

So, I want to know if it is possible to encrypt the JDBC connection string, in order to avoid anyone can access my DB.

I use this string in my program code:
Class.forName("com.mysql.jdbc.Driver").newInstance();
con =
DriverManager.getConnection("jdbc:mysql://localhost/my_db_name","my_user_name", "my_password");
The problem is, if anyone decompile class files of my app,
he can read user and pass, and easily access to DB.

I could store user and pass in a file, but I always need to encrypt them.

Is it possible to encrypt database connection user and pass?

Thank you in advance.

MargNat

Message was edited by:
MargNat
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2007
Added on Feb 19 2007
5 comments
1,060 views