How do I encrypt the password in JDBC Connect string?
1 posts in topic
Flat View  Flat View

Posted By:   Aarun_Jones
Posted On:   Tuesday, December 13, 2005 07:28 PM

We all know that when we connect to a database using DriverManager.getConnection we pass in the url, username and password to get a connection to database. Instead of plain text for password, is it possible to use an encrypted one? Same for using in hibernate.cfg file also.

What is the best practice?



Re: How do I encrypt the password in JDBC Connect string?

Posted By:   ankush_purwar  
Posted On:   Wednesday, December 14, 2005 04:34 AM

If you will send the encrypted password to GetConnection () API , your authentication with db will always fail.

There are two ways for this :
Interactive mode
I suggest you to collect the password dynamically and send to API, don't try to persist it in Some where.

2. Persist mode
If you still want to persist password in some cases, then after encryption you can store in some file,
but before passing password to API , you must decrypt the same.
About | Sitemap | Contact