aspose file tools*
The moose likes JDBC and the fly likes How to get Password value from Connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to get Password value from Connection" Watch "How to get Password value from Connection" New topic
Author

How to get Password value from Connection

Ram Chhabra
Ranch Hand

Joined: Jan 07, 2008
Posts: 48
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

Joined: Oct 13, 2005
Posts: 39393
    
  28
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

Joined: May 26, 2003
Posts: 30752
    
156

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Brian Mozhdehi
Ranch Hand

Joined: Aug 17, 2006
Posts: 81
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get Password value from Connection