Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How di I hide or encrypt the username n password connecting to a DB 1

Status
Not open for further replies.

FreshmenProgrammer

Programmer
Jan 16, 2006
42
CA
I was just wondering how i can encrypt or hide the connection string or mainly the username and password information from users. I am connecting to mySQL through .jsp here. Also I am coding a test program with mySQL but i have to connect to DB2 connect. Will that be a hard transition and is the encryption for logging in the same as it would be here. I new to programming. I hope someone can help me out. Thank you.

Code:
String connectionURL = "jdbc:mysql://localhost:3306/test2?user=whatever&password=whatever";
 
If you want to encrypt anything, then you need to use the JCE (Java Cryptography Extension). See to download it. I suggest reading the simple tutorials there on cryptography aswell.

The JDBC API allows transparency between database vendors. So you should be able to run the same code against MySQL as you can against DB2 (in theory).

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top