Can any one help me in this problem ?
I have created an URL to get the information from some site say as
"WWW.SiteName.com"
Program is,
import java.net.*;
import java.io.*;
import java.util.Date;
class UCDemo
{
public static void main(String args[]) throws Exception
{
URL hp = new URL("http://www.SiteName.com/");
URLConnection hpCon = yahoo.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(
hpCon.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
}
I am getting the UnknownhostException turned on though my computer is connected to
the net.
But when i am accessing the intrnal site i not getting any error message,so
how can i avoid the exception for the external sites avoiding this error.Can any one
please give the complete detailed information on this to me immediately.