This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes determine database server hostname from Connection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "determine database server hostname from Connection" Watch "determine database server hostname from Connection" New topic
Author

determine database server hostname from Connection

Geoffrey Falk
Ranch Hand

Joined: Aug 17, 2001
Posts: 171
I have a java.sql.Connection object, and I need to determine the hostname of the database server. Is there any way to extract this information somehow? Even to retrieve the JDBC URL would be helpful.

Thanks
Geoffrey


Sun Certified Programmer for the Java 2 Platform
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3652

Connection.getMetaData()


My Blog: Down Home Country Coding with Scott Selikoff
Geoffrey Falk
Ranch Hand

Joined: Aug 17, 2001
Posts: 171
... specifically,



Thanks!
Geoffrey
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: determine database server hostname from Connection
 
Similar Threads
Is Database location an option in properties file ?
local vs networked mode
NX: suncertify.properties
Error in connecting to database
GUI question