易截截图软件、单文件、免安装、纯绿色、仅160KB

java 下载文件的方法

前不久写了个下载文件的方法。经过一段时间在程序中的运用,发现了几个问题。修正一下:
public static  File saveToFiles(String destUrl,String path) throws IOException {
            final int BUFFER_SIZE = 4096;
            System.out.println("file download url is "+destUrl+" path is"+path+"--------------");
            FileOutputStream fos = null;
            BufferedInputStream bis = null;
            HttpURLConnection httpconn = null;
            URL url = null;
            byte[] buf = new byte[BUFFER_SIZE];
            int size = 0;
            if(rc.isUseProxy()){   // 此处为读取配置文件的内容,确定是否使用代理
                Properties   prop   =   System.getProperties(); 
                   //set http  proxy addr
                 prop.setProperty("http.proxyHost",   rc.getHttpProxyHost());      //设置代理的Ip
                  // set http  proxy port
                 prop.setProperty("http.proxyPort",   rc.getHttpProxyPort()+"");   //设置代理的端口
            }   
      &n


相关文档:

java jdbc 调用 oracle存储过程 返回游标

1.创建测试表
create table users(
userid int primary key,
username varchar2(20),
userpwd  varchar2(20)
);
insert into users values(1,'test','test');
insert into users values(2,'test','test');
insert into users values(3,'test','test');
insert into users values(4,'test','test');
insert i ......

java mysql 汉字存入时乱码


从网络摘抄到的解决方法——
解决方法二:
      连接mysql时(无论在从mysql读还是取数据的情况),指定使用的编码方式为utf-8,具体代码如下
      //装载mysql-jdbc驱动
       Class.forName("com.mysql.jdbc.Driver" ......

21天学通Java 下载参考

21天学通Java6  下载地址 http://d.download.csdn.net/down/2031000/bolike(只有源代码)
<<21天学通Java 2(第二版)>>(中英文版PDF)+附书源码  下载地址 http://www.zzx8.com/html/c16246.html(似乎中英文的不对应,看中文还是看英文的?) ......

java 反射

通过反射创建新类示例的两种方式及比较
作者BLOG:http://blog.csdn.net/fenglibing
通过反射创建新的类示例,有两种方式:
Class.newInstance()
Constructor.newInstance()
以下对两种调用方式给以比较说明:
l             Class.newInstance() 只能 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号