This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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
    
    1
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: 3700
    
    5

Connection.getMetaData()


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

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



Thanks!
Geoffrey
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: determine database server hostname from Connection
 
Similar Threads
GUI question
local vs networked mode
Error in connecting to database
NX: suncertify.properties
Is Database location an option in properties file ?