• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

determine database server hostname from Connection

 
Geoffrey Falk
Ranch Hand
Posts: 171
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Scott Selikoff
author
Saloon Keeper
Posts: 4015
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Connection.getMetaData()
 
Geoffrey Falk
Ranch Hand
Posts: 171
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... specifically,



Thanks!
Geoffrey
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic