Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2005

Tip: Looking for answers? Try searching our database.

JDBC retrieve the server name/ip from a java.sql.connection

Thread view: 
dnasmars - 28 Sep 2005 15:00 GMT
Hi all,

is it possible to retrieve the server name or ip
from a Connection or a Statement
from the package java.sql.
thank you in advance
Roedy Green - 28 Sep 2005 20:48 GMT
>is it possible to retrieve the server name or ip
>from a Connection or a Statement
>from the package java.sql.
>thank you in advance

Try Driver.getPropertyInfo and dig around to see what is in there.  
I gather you have already pawed through Connection.getMetaData

Perhaps you can get an URL and from that a name and from that an IP.

See http://mindprod.com/jgloss/uri.html
http://mindprod.com/jgloss/ip.html

Another approach is to save the url when you are constructing your
connect string rather than trying to extract it later.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

dnasmars - 29 Sep 2005 11:08 GMT
>>is it possible to retrieve the server name or ip
>
[quoted text clipped - 13 lines]
> Another approach is to save the url when you are constructing your
> connect string rather than trying to extract it later.
thank you for the information I'll try
and will let you all know :)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.