How to get database url from java.sql.Connection?

前端 未结 4 1305
无人共我
无人共我 2020-12-08 12:54

For given Connection instance how do I find out url that the Connection uses to connect the database ? Is it somewhere in Properties returned by Co

4条回答
  •  感情败类
    2020-12-08 13:27

    connection.getClientInfo() has all the details related to connection. It returns a properties object. You can retrieve the value of "password" property to fetch the password that was used for the connection object.

    Please let me know if this solves your problem.

提交回复
热议问题