FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!

Database Connectivity




Since we are connecting to mySQL database, we decided to use Connector/J.



1 blog comments below

public static String getValueFromURL(String host){
try{
URL url = new URL(host);
URLConnection urlCon = url.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(
urlCon.getInputStream()));
String inputLine;

String result="";
while ((inputLine = in.readLine()) != null)
result += inputLine;
in.close();

return result;
}catch(IOException io){

}
return ""; //return nothing on error perhaps
}
delsoft on Tue Feb 09, 2010 2:58 pm



FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.