Solved

How Do I check if I can connect to a system from java

Posted on 1998-08-01
2
173 Views
Last Modified: 2010-03-30
From my program I want to check if I can connect to a URL if not exit gracefully
0
Comment
Question by:vas1
2 Comments
 
LVL 2

Accepted Solution

by:
aziz061097 earned 100 total points
ID: 1230039
SecurityManager sm = System.getSecurityManager();

if (security != null)
{
try
  {
  sm.checkConnect("www.experts-exchange.com",80);
  }
  catch(SecurityException ex)
  {
   // catch exceptions
  }
}
0
 

Author Comment

by:vas1
ID: 1230040
Thanks for the prompt reply . I think this will work. Thanks again.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HashMap Vs TreeMap 12 55
Python Assistance 7 73
ArrayIndexOutOfBoundException 9 67
Where to store the queries for modification of table 4 54
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now