954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Something's wrong with this code :(

i have this code, when i run this script no error shows up, but at the same time no result shows up too :(
i dont understand where the problem is... :(

String result2="";
		String data2;
		URL u2;
		URLConnection uc2;
		
		u2 = new URL("http://genome.ucsc.edu/cgi-bin/hgc?o=32385948&g=htcUserAli&i=../trash/hgSs/hgSs_genome_44ba_e972d0.pslx+..%2Ftrash%2FhgSs%2FhgSs_genome_44ba_e972d0.fa+YourSeq&c=chr1&l=32385948&r=32386166&db=hg19&hgsid=204152805282 ");
		uc2 = u2.openConnection();
		
		InputStream is2 = uc2.getInputStream(); 
		BufferedReader reader2 = new BufferedReader(new InputStreamReader(is2));
		while((data2 = reader2.readLine()) != null){
			result2 += data2;
		}
		String firstString2 = "<HTML>";
		int startFrom2 = result2.indexOf(firstString2);		
//out.print("this is startFrom2 int: "+startFrom2);
		String getHTML2 = result2.substring(startFrom2, result2.length());
		out.println(getHTML2);	//'<==========STH'S WRONG IN HERE!!!!!
gingerfish
Light Poster
47 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

Well, where is your catch block for this, as any number of exceptions can be thrown by this code, and I have the sneaking suspiscion that you are ignoring them.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: