Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get Password value from Connection

 
Ram Chhabra
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

As per my code, i am connected to database successfully.
Suppose i am having my connection object as con.

Now, i just want some information about that connection in java code. I am able to get the url and username by the below code:



But i am not able to fetch the value of password. Can you please tell me that how to get the value of password, which connection is using?

Thanks,
Ram
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do a search through this forum; a similar topic came up about two weeks ago.
I think we concluded it is impossible to extract a password with simple SQL.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ram,
In the discussion Campbell refers to, we had some back and forth about why one would need the password. If you say what you are trying to accomplish, someone might be able to give you an alternate approach.
 
Brian Mozhdehi
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not able to do this because the API doesnt allow it - being able to do so would pose a security risk to the associated application.

I presume you have the password already otherwise you wouldnt be able to connect in your code?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic