JavaÎÞÐè½âѹֱ½Ó¶ÁÈ¡ZipÎļþÀïµÄÎļþÄÚÈÝ
package com.wicresoft.jpo;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
public class ReadZipUtil {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
readZipFile("D:\\test\\test.zip");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void readZipFile(String file) throws Exception {
ZipFile zf = new ZipFile(file);
InputStream in = new BufferedInputStream(new FileInputStream(file));
ZipInputStream zin = new ZipInputStream(in);
ZipEntry ze;
while ((ze = zin.getNextEntry()) != null) {
if (ze.isDirectory()) {
// System.out.print("directory - " + ze.getName() + " : "
// + ze.getSize() + " bytes");
// System.out.println();
} else {
System.err.println("file - " + ze.getName() + " : "
+ ze.getSize() + " bytes");
long size = ze.getSize();
if (size > 0) {
BufferedReader br = new BufferedReader(
new InputStreamReader(zf.getInputStream(ze)));
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
br.close();
}
System.out.println();
}
}
zin.closeEntry();
}
}
Ïà¹ØÎĵµ£º
8.9.3 ³éÏóÀàºÍ½Ó¿ÚµÄ±È½Ï
³éÏóÀàºÍ½Ó¿Ú¶¼ÊǽøÐÐÃæÏò¶ÔÏóÉè¼ÆÊ±×¨ÓõÄÉè¼Æ½á¹¹£¬ÔÚʵ¼Ê½øÐÐÏîÄ¿Éè¼ÆÊ±£¬¾³£ÐèÒª¿¼ÂǵÄÎÊÌâ¾ÍÊÇ——“ʹÓóéÏóÀ໹Êǽӿڔ£¿ÏÂÃæÍ¨¹ý¶ÔÓÚ³éÏóÀàºÍ½Ó¿Ú½øÐмòµ¥µÄ±È½Ï£¬ÊìϤÁ½ÕßÖ®¼äµÄÇø±ðºÍÁªÏµ£¬´Ó¶øÔÚʵ¼ÊÉè¼ÆÊ±Ê ......
Ò»¸öJava½Ó¿Ú(Interface)ÊÇһЩ·½·¨ÌØÕ÷µÄ¼¯ºÏ£¬ÕâЩ·½·¨ÌØÕ÷µ±È»À´×ÔÓÚ¾ßÌåµÄ·½·¨£¬µ«ÊÇËüÃÇÒ»°ã¶¼À´×ÔÓÚϵͳÖв»¶Ï³öÏֵķ½·¨¡£Ò»¸ö½Ó¿ÚÖ»Óз½·¨µÄÌØÕ÷£¬¶øÃ»Óз½·¨µÄʵÏÖ£¬Òò´ËÕâЩ·½·¨ÔÚ²»Í¬µÄµØ·½±»ÊµÏÖʱ£¬¿ÉÒÔÓÐÍêÈ«²»Í¬µÄÐÐΪ¡£ÔÚJavaÓïÑԵģ¬Java½Ó¿Ú»¹¿ÉÒÔ¶¨ÒåPublic³£Á¿¡£ ......
ÕªÒª: ×î³õjavaÊDz»Ö§³Ö¶ÔÎı¾ÎļþµÄ´¦ÀíµÄ£¬ÎªÁËÃÖ²¹Õâ¸öȱº¶¶øÒýÈëÁËReaderºÍWriterÁ½¸öÀà
×î³õjavaÊDz»Ö§³Ö¶ÔÎı¾ÎļþµÄ´¦ÀíµÄ£¬ÎªÁËÃÖ²¹Õâ¸öȱº¶¶øÒýÈëÁËReaderºÍWriterÁ½¸öÀ࣬ÕâÁ½¸öÀà¶¼ÊdzéÏóÀ࣬WriterÖÐ write(char[] ch,int off,int
length)£¬flush()ºÍclose()·½·¨Îª³éÏó·½·¨£¬ReaderÖÐread(char[] ch, ......
»·¾³£ºÊý¾Ý¿âsql server2005£¬jdk1.6 £¬myeclipse£¬Çý¶¯jdts1.2.2
Ö´ÐÐÒÔÏ´úÂ룬±¨´í£º
String querySQL = "{?=call p_sys_manager_csReport(?,?,?,?,?)}";
cstmt = conn.prepareCall(querySQL);
cstmt.registerOutParameter(1, java.sql.Types.INTEGER);
cstmt.setInt(2, modType);
cstmt.setInt(3, dptI ......