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

java²Ù×÷Excel

// ´´½¨Excel
    String destFileName = tableName + ".xls";//ÎļþÃû
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment; filename=".concat(String .valueOf(destFileName)));
    
WorkbookSettings wbs = new WorkbookSettings();
    WritableWorkbook w = Workbook.createWorkbook(response .getOutputStream(), wbs);//´ò¿ªÎļþ
    jxl.write.WritableSheet ws = w.createSheet("sheet0", 0);// // Éú³ÉÃûΪ“sheet0”µÄ¹¤×÷±í£¬²ÎÊý0±íʾÕâÊǵÚÒ»Ò³   
   // ÔÚLabel¶ÔÏóµÄ¹¹Ôì×ÓÖÐÖ¸Ãûµ¥Ôª¸ñλÖÃÊǵÚÒ»ÁеÚÒ»ÐÐ(0,0)
   // ÒÔ¼°µ¥Ôª¸ñÄÚÈÝΪtest
   Label label = new Label(0, 0, "test123");
  
   // ½«¶¨ÒåºÃµÄµ¥Ôª¸ñÌí¼Óµ½¹¤×÷±íÖÐ
   sheet.addCell(label);
    // ×ÖÌåÉèÖÃ
    WritableFont font = new WritableFont(WritableFont.createFont("¿¬Ìå_GB2312"), 12, WritableFont.BOLD);
    WritableCellFormat format = new WritableCellFormat(font);
    format.setBackground(jxl.format.Colour.GRAY_25);
    format.setLocked(false);//µ¥Ôª¸ñËø¶¨
    format.setBorder(jxl.format.Border.ALL,
      jxl.format.BorderLineStyle.getStyle(1));
    format.setWrap(true);//ÉèÖÃ×Ô¶¯»»ÐÐ
    // ×ÖÌåÉèÖýáÊø
  // µ¥Ôª¸ñÉèÖÃÄÚÈÝ£¨ÒÔϱíʾ£¬µÚiÁУ¬µÚ1ÐУ©
·½Ê½1£º 
   ExcelUtil.makeCellData(ws, i, 0, (String) map.get("BTF_TITLE"), ExcelUtil.LABEL_ALIGN_LEFT,ExcelUtil.BORDER_LINE_ALL, null, ExcelUtil.CELL_TYPE_LABEL,jxl.format.Colour.GRAY_25);
·½Ê½2£º
     ws.addCell(new Label(i, 0, (String) map.get("BTF_TITLE"), format));
//×îºóдÎļþ£¬¹Ø±Õ
  w.write();
  w.close();
//º


Ïà¹ØÎĵµ£º

Javaʼþ»úÖÆ

 Ê¼þÔ´¸ºÔð²úÉúʼþ
ʼþÀࣺ¶¨ÒåʼþµÄÌØÕ÷£»
¼àÌýÆ÷½Ó¿Ú£º¶¨Òå¼àÌýÆ÷Ó¦¸ÃʵÏֵŦÄÜ£»
¼àÌýÆ÷£ºÊµÏÖ¼àÌýÆ÷½Ó¿Ú£¬¼àÌýʼþµÄ·¢Éú²¢×÷³öÏìÓ¦£»
ËùÓеÄʼþÀà±ØÐë¼Ì³ÐJavaʼþ»ùÀ࣬¼´java.util.EventObject£»EventObject(Object source)ÊÇEventObjectΨһµÄ¹¹Ôì·½·¨£¬ÕâÒâζ×ÅËùÓÐʼþ±ØÐëÔÚʵÀý»¯Ê±¾ÍÖ¸¶¨Ê¼þÔ´ ......

java ʼþ»úÖÆ̽ÌÖ

javaÖеÄʼþ»úÖƵIJÎÓëÕßÓÐ3ÖÖ½ÇÉ«£º
1.event object£º¾ÍÊÇʼþ²úÉúʱ¾ßÌåµÄ“ʼþ”£¬ÓÃÓÚlistenerµÄÏàÓ¦µÄ·½·¨Ö®ÖУ¬×÷Ϊ²ÎÊý£¬Ò»°ã´æÔÚÓëlisternerµÄ·½·¨Ö®ÖÐ
2.event source£º¾ßÌåµÄ½ÓÊÜʼþµÄʵÌ壬±ÈÈç˵£¬Äãµã»÷Ò»¸öbutton£¬ÄÇôbutton¾ÍÊÇevent source£¬ÕâÑùÄã±ØÐëʹbutton¶ÔijЩʼþ½øÐÐÏàÓ¦£¬Äã¾ÍÐè ......

Java Àà×°ÈëÆ÷Ô­Àí

 
תÔØ×Ôhttp://blog.csdn.net/yuekun1172006/archive/2007/06/02/1634878.aspx
Àà×°ÈëÆ÷ÊÇ JVM ÓÃÀ´×°ÈëÀàµÄÀ࣬Ëü¶ÔÓÚ Java ±à³ÌÊǷdz£ÖØÒªµÄÒ»¸ö¸ÅÄî¡£Ò»°ãÇé¿öÏ£¬³ÌÐòÔ±ÔÚ±àд³ÌÐòµÄʱºò¶¼¿ÉÒÔºöÂÔÀà×°ÈëÆ÷µÄ´æÔÚÐÔ¡£µ«ÊǶÔÓÚ·þÎñÆ÷¶Ë±à³Ì»òÕßÊÇһЩÌØÊâÇé¿öÏÂʱºò£¬ÉîÈëÁ˽âÀà×°ÈëÆ÷µÄ»úÖÆÒÔ¼°ÆäÔÚ²»Í¬Çé¿öϵ ......

java.lang.OutOfMemoryError: Java heap space

 
ÎÊÌâÃèÊö
Exception in thread "main" java.lang.OutOfMemoryError:
Java heap space
½â¾ö·½°¸[ת]
Ò»Ö±¶¼ÖªµÀ¿ÉÒÔÉèÖÃjvm heap´óС£¬Ò»Ö±ÓÃeclipseд/µ÷ÊÔjava³ÌÐò¡£Ò»Ö±ÓÃÃüÁîÐÐor
console¼Ó²ÎÊýÅܳÌÐò¡£ÏÖÏó£ºÔÚeclipseµÄÅäÖÃÎļþeclipse.iniÖÐÉèÖÃ-vmargs -Xms500m
-Xmx1024m
£¬ÔÚeclipseÖ ......

ͨ¹ýibatisµÄblob ´æ´¢javaµÄhashmap

 Õ⼸Ìì²âÊÔblob»ñÈ¡ºÍ´æ´¢µÄʱºò,±»¿¨Á˺ܾÃ,×îºó²Å·¢ÏÖÊÇÕ¼ÓÃÁ˹ؼü×Öµ¼ÖÂÎÞ·¨»ñÈ¡½á¹û,ѪµÄ½Ìѵ°¡.
ÒÔºóÆðÃû×ÖÒªÓÃ×î¶ñÐĵÄ,²»ÒªÓÃ×î·½±ãµÄÁË.Ïл°ÉÙ˵,javaµÄhashmapÊDz»ÄÜÖ±½Ó´æ´¢µ½Êý¾Ý¿âÖеÄ.
±¾µØÊý¾Ý¿âΪmysql,ÀïÃæÓÐblobµÄÀàÐͿɹ©Ê¹ÓÃ.·½·¨Ò²ºÜ¼òµ¥,ÉÏ´úÂë
Êý¾Ý¿â½¨±í
CREATE TABLE `test` (
`id` ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ