English 中文(简体)
• 如何从java.sql中检索密码。 联系物体
原标题:How to retrieve the password from a java.sql.Connection object

I m 寻找一条途径,从 j木 object树林中获取密码。 我知道,数据库MetaData物体采用“UserName()”方法,但不幸的是,没有相应的“Pasword()”方法。 借助网户的夸张,我可以看到一个口号,因此,必须有一种办法,利用思考来获取这一信息,但迄今为止,我一直无法说明情况。

最佳回答

正如我评论的那样,唯一的办法必须是研究守则。 例如,MySQL使用最新司机(5.1.15)。 你可以这样说:

public static void main(String[] args) throws Exception{
  ConnectionImpl con = (ConnectionImpl) DriverManager.getConnection("jdbc:mysql://localhost:3908/mydb?user=edalorzo&password=mandrake");

   System.out.println(con.getProperties().get("password"));

   con.close();
}

But for this, you would need to know the class hierarchy and its implementation details.

Other databases most probably will be different. If your database is open source, like MySQL you can know the details of the inner construction and find ways to retrieve the password.

问题回答

您可以把XML组合参数的单相平,并从那里获得密码。 复杂的解决办法,但行之有效。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签