我的代码如下:
package com.yysoft.stock.price;import java.io.BufferedInputStream;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;public class GetDataByURL {
public static String cc(String leibie, String num) {
        StringBuffer temp = new StringBuffer();
        try {
            System.out.println(leibie);
            System.out.println(num);
            String url = "http://qt.gtimg.cn/q=sh600036";
            HttpURLConnection uc = (HttpURLConnection)new URL(url).
                                   openConnection();
            uc.setConnectTimeout(10000);
            uc.setDoOutput(true);
            uc.setRequestMethod("GET");
            uc.setUseCaches(false);
            DataOutputStream out = new DataOutputStream(uc.getOutputStream());            // 要传的参数
            String s = URLEncoder.encode("ra", "GB2312") + "=" +
                       URLEncoder.encode(leibie, "GB2312");
            s += "&" + URLEncoder.encode("keyword", "GB2312") + "=" +
                    URLEncoder.encode(num, "GB2312");
            // DataOutputStream.writeBytes将字符串中的16位的unicode字符以8位的字符形式写道流里面
            out.writeBytes(s);
            out.flush();
            out.close();
            InputStream in = new BufferedInputStream(uc.getInputStream());
            Reader rd = new InputStreamReader(in, "Gb2312");
            int c = 0;
            while ((c = rd.read()) != -1) {
                temp.append((char) c);
            }
            System.out.println(temp.toString());
            in.close();        } catch (Exception e) {
            e.printStackTrace();
        }
        return temp.toString();
    }public static void main(String[] a){
GetDataByURL.cc("1","吉H");
    }}
现在的问题是,上面的的URL会报错:
java.io.IOException: Server returned HTTP response code: 500 for URL: http://qt.gtimg.cn/q=sh601989
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
at com.yysoft.stock.price.GetDataByURL.cc(GetDataByURL.java:38)
at com.yysoft.stock.price.GetDataByURL.main(GetDataByURL.java:54)而如果换别的URL,像http://www.hao123.com/ 或其它新浪的都没有问题,可以正常打印出页面内容,但是我想用如代码中的URLhttp://qt.gtimg.cn/q=sh601989就出错了,这个是腾讯的股票数据采集接口,我想采集它的数据,请问下大家我怎么解决这个问题啊JavaURLString