Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Êý¾Ýת»»excelµÄjava³ÌÐò

 ÒªÓõ½jxlµÄ°ü
¾ßÌåʵÀý
1.Éú³ÉexcelÎļþ
package com.createexcel;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import com.mysql.jdbc.ResultSetMetaData;
import jxl.Workbook;
import jxl.format.Colour;
import jxl.format.UnderlineStyle;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import com.bean.DataInfo;
public class CreateExcel {
  
 public void CreateExcel(String targetfile,String start,String end) {
    
            String worksheet = "ÈÕÖ¾Êä³ö";       //Êä³öµÄexcelÎļþ¹¤×÷±íÃû
     GetDataInfo data=new GetDataInfo();
     List list=new ArrayList();
     list=data.getdata(start,end);
     if(list.size()!=0){
        int colCount=0;
        TestDao test=new TestDao();
        ResultSet  rs = test.selectSql("SELECT * from datainfo");                                        
       
            WritableWorkbook workbook;
      try{
 System.out.println("begin");
 //´´½¨¿ÉдÈëµÄExcel¹¤×÷±¡,ÔËÐÐÉú³ÉµÄÎļþÔÚtomcat/binÏÂ
 //workbook = Workbook.createWorkbook(new File("output.xls"));
 OutputStream os=new FileOutputStream(targetfile);
 workbook=Workbook.createWorkbook(os);
 WritableSheet sheet = wo


Ïà¹ØÎĵµ£º

java±ÊÊÔ»ã×Ü£¨2£©

41¡¢ÊÇ·ñ¿ÉÒԼ̳ÐStringÀà?
StringÀàÊÇfinalÀà¹Ê²»¿ÉÒԼ̳С£
42¡¢swtichÊÇ·ñÄÜ×÷ÓÃÔÚbyteÉÏ£¬ÊÇ·ñÄÜ×÷ÓÃÔÚlongÉÏ£¬ÊÇ·ñÄÜ×÷ÓÃÔÚStringÉÏ?
switch£¨expr1£©ÖУ¬expr1ÊÇÒ»¸öÕûÊý±í´ïʽ¡£Òò´Ë´«µÝ¸ø switch ºÍ case Óï¾äµÄ²ÎÊýÓ¦¸ÃÊÇ int¡¢ short¡¢ char »òÕß byte¡£long,st ......

javaµ¥Ì¬Ä£Ê½½²½â

µ¥Ì¬¶¨Òå:
        SingletonģʽÖ÷Òª×÷ÓÃÊDZ£Ö¤ÔÚJavaÓ¦ÓóÌÐòÖУ¬Ò»¸öÀàClassÖ»ÓÐÒ»¸öʵÀý´æÔÚ¡£
        Singletonģʽ¾ÍΪÎÒÃÇÌṩÁËÕâÑùʵÏֵĿÉÄÜ¡£Ê¹ÓÃSingletonµÄºÃ´¦»¹ÔÚÓÚ¿ÉÒÔ½ÚÊ¡Äڴ棬ÒòΪËüÏÞÖÆÁËʵÀýµÄ¸öÊý£¬ÓÐÀûÓÚJavaÀ¬»ø»ØÊÕ£¨garbage col ......

javaʵÏÖðÅÝÅÅÐòËã·¨

  package ch01;
 
 public class BubbleSort
 {
    
   
    public static void main(String[] args){
        int[] values ={
          &n ......

Java¹æÔòÒýÇ湤×÷Ô­Àí¼°ÆäÓ¦ÓÃ(Õª)


Java¹æÔòÒýÇ湤×÷Ô­Àí¼°ÆäÓ¦ÓÃ
¡¡¡¡Õª Òª Java¹æÔòÒýÇæÊÇÒ»ÖÖǶÈëÔÚJava³ÌÐòÖеÄ×é¼þ£¬ËüµÄÈÎÎñÊǰѵ±Ç°Ìá½»¸øÒýÇæµÄJavaÊý¾Ý¶ÔÏóÓë¼ÓÔØÔÚÒýÇæÖеÄÒµÎñ¹æÔò½øÐвâÊԺͱȶԣ¬¼¤»îÄÇЩ·ûºÏµ±Ç°Êý¾Ý״̬ϵÄÒµÎñ¹æÔò£¬¸ù¾ÝÒµÎñ¹æÔòÖÐÉùÃ÷µÄÖ´ÐÐÂß¼­£¬´¥·¢Ó¦ÓóÌÐòÖжÔÓ¦µÄ²Ù×÷¡£
¡¡¡¡ÒýÑÔ
¡¡¡¡Ä¿Ç°£¬JavaÉçÇøÍƶ¯²¢·¢Õ¹Á ......

javaÖÐÈçºÎÕýÈ·¶ÁÈ¡ÅäÖÃÎļþ

½ñÌìÏë¶ÁÈ¡srcϵÄÅäÖÃÎļþ£¬ÒÔǰһֱûÕÒµ½·½·¨£¬½ñÌìÑо¿ÁËÏÂÖÕÓÚOKÁË 
System.out.println("path1:" + getClass().getResource("config.xml").getPath());
 
System.out.println("path2:" + getClass().getClassLoader().getResource("config.xml").getPath());
 
path1:/D:/DJ/workspace/.metadata ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ