Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • 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: 4020
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic