File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 3697
    
    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
Error in connecting to database
Is Database location an option in properties file ?
NX: suncertify.properties
local vs networked mode
GUI question