String picture = ??;   //图片地址
BufferedImage BufferImg = ImageIO.read(new File(picture));  
如果这个图片地址是在百度之类的,怎么不能导了,求高手解救!       
知道的兄弟吼二下吧!!!!!!!!!!!!!!!!!!!!

解决方案 »

  1.   

    不至于啊!!!!   应该什么都能倒出来的
      数据库转换成String 然后在以String的形式写入excel的啊!!!!!!  不是你的方法写错了吧
    !!!!!!  只有读取的时候才会因为一些类型转或出现错误!!! 但是你的是导出 没什么情况吧!!!
      

  2.   

    貌似可以public static void main(String[] args) {
    saveUrlAs("http://www.baidu.com/img/baidu_jgylogo3.gif","e:/a.gif");
    }
    public static boolean saveUrlAs(String photoUrl, String fileName) {
    try { URL url = new URL(photoUrl);
    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
    DataInputStream in = new DataInputStream(connection.getInputStream());
    DataOutputStream out = new DataOutputStream(new FileOutputStream(fileName));
    byte[] buffer = new byte[4096];
    int count = 0;
    while ((count = in.read(buffer)) > 0) {
    out.write(buffer, 0, count);
    }
    out.close();
    in.close();
    return true;
    }
    catch (Exception e) {
    return false;
    }
    }