Ö÷Ì⣺ʵսjava Concurrent
±àд¶àÏ̵߳ijÌÐòÒ»Ö±¶¼ÊÇÒ»¼þ±È½ÏÂé·³µÄÊÂÇ飬Ҫ¿¼ÂǺܶàÊÂÇ飬´¦Àí²»ºÃ»¹»á³öºÜ¶àÒâÏë²»µ½µÄÂé·³¡£¼ÓÉÏÏÖÔںܶ࿪·¢Õß½Ó´¥µ½µÄÏîÄ¿¶¼ÊÇ´ò×ÅÆóÒµ¼¶ÆìºÅµÄB/SÏîÄ¿£¬´ó¶àÊýÈ˶¼ºÜÉÙÉæ¼°¶àỊ̈߳¬ÕâÓÖΪ±¾ÎĵÄÖ÷½ÇÔö¼ÓÁËÒ»·ÝÉñÃظС£
½²µ½Java¶àỊ̈߳¬´ó¶àÊýÈËÄÔº£ÖÐÌø³öÀ´µÄÊÇThread¡¢Runnable¡¢synchronized……ÕâЩÊÇ×î»ù±¾µÄ¶«Î÷£¬ËäÈ»ÒѾ×㹻ǿ
´ó£¬µ«ÏëÒªÓúû¹Õæ²»ÈÝÒס£´ÓJDK
1.5¿ªÊ¼£¬Ôö¼ÓÁËjava.util.concurrent°ü£¬ËüµÄÒýÈë´ó´ó¼ò»¯Á˶àÏ̳߳ÌÐòµÄ¿ª·¢£¨Òª¸ÐлһÏ´óÅ£Doug Lee£©¡£
java.util.concurrent°ü·Ö³ÉÁËÈý¸ö²¿·Ö£¬·Ö±ðÊÇjava.util.concurrent¡¢
java.util.concurrent.atomicºÍjava.util.concurrent.lock¡£ÄÚÈݺ¸ÇÁ˲¢·¢¼¯ºÏÀà¡¢Ï̳߳ػúÖÆ¡¢Í¬
²½»¥³â»úÖÆ¡¢Ḭ̈߳²È«µÄ±äÁ¿¸üй¤¾ßÀà¡¢ËøµÈµÈ³£Óù¤¾ß¡£
ΪÁ˱ãÓÚÀí½â£¬±¾ÎÄʹÓÃÒ»¸öÀý×ÓÀ´×ö˵Ã÷£¬½»´úÒ»ÏÂËüµÄ³¡¾°£º
¼ÙÉèÒª¶ÔÒ»Ì×10¸ö½Úµã×é³ÉµÄ»·¾³½øÐмì²é£¬Õâ¸ö»·¾³ÓÐÁ½¸öÈë¿Úµã£¬Í¨¹ý½Úµã¼äµÄÒÀÀµ¹Øϵ¿ÉÒÔ±éÀúµ½Õû¸ö»·¾³¡£ÒÀÀµ¹Øϵ¿ÉÒÔ¹¹³ÉÒ»ÕÅÓÐÏòͼ£¬¿ÉÄÜ´æÔÚ»·¡£ÎªÁËÌá¸ß¼ì²éµÄЧÂÊ£¬¿¼ÂÇʹÓöàÏ̡߳£
1¡¢Executors
ͨ¹ýÕâ¸öÀàÄܹ»»ñµÃ¶àÖÖÏ̳߳صÄʵÀý£¬ÀýÈç¿ÉÒÔµ÷ÓÃnewSingleThreadExecutor()»ñµÃµ¥Ï̵߳Ä
ExecutorService£¬µ÷ÓÃnewFixedThreadPool()»ñµÃ¹Ì¶¨´óСÏ̳߳صÄExecutorService¡£Äõ½
ExecutorService¿ÉÒÔ×öµÄÊÂÇé¾Í±È½Ï¶àÁË£¬×î¼òµ¥µÄÊÇÓÃËüÀ´Ö´ÐÐRunnable¶ÔÏó£¬Ò²¿ÉÒÔÖ´ÐÐһЩʵÏÖÁË
Callable<T>µÄ¶ÔÏó¡£ÓÃThreadµÄstart()·½·¨Ã»Óзµ»ØÖµ£¬Èç¹û¸ÃÏß³ÌÖ´Ðеķ½·¨Óзµ»ØÖµÄÇÓÃ
ExecutorService¾ÍÔٺò»¹ýÁË£¬¿ÉÒÔÑ¡Ôñsubmit()¡¢invokeAll()»òÕßinvokeAny()£¬¸ù¾Ý¾ßÌåÇé¿öÑ¡ÔñºÏÊʵķ½
·¨¼´¿É¡£
Java´úÂë
package
service;
import
java.util.ArrayList;
import
java.util.List;
import
java.util.concurrent.ExecutionException;
import
java.util.concurrent.ExecutorService;
import
java.util.concurrent.Executors;
import
java.util.concurrent.Future;
import
java.util.concurrent.TimeUnit;
/**
* Ï̳߳طþÎñÀà
*
* @author DigitalSonic
&n
Ïà¹ØÎĵµ£º
ÉÏ´Î談過ÁËʹÓÃiText產ÉúPDF檔£¬這´Î換³É來談談ʹÓÃJExcel來產ÉúEXCEL檔µÄ·½·¨¡£
Ê×ÏÈ£¬Ïȵ½ËûµÄSourceForgeÖ÷頁ÃædownloadÏà關µÄAPI檔°¸¡£
http://sourceforge.net/projects/jexcelapi/
»ò
http://www.andykhan ......
²Î¿¼:
¡¡¡¡http://danadler.com/jacob/
¡¡¡¡http://jakarta.apache.org/poi/
¡¡¡¡http://www.onjava.com/pub/a/onjava/2003/01/22/poi.html
¡¡¡¡http://www.csdn.net/develop/article/15/15311.shtm
¡¡¡¡http://forum.java.sun.com/thread.jsp?forum=40&thread=382666&tstart=0&trange=15
¡¡¡¡Java Excel ......
java jce¶ÔaesËã·¨ÓкܺõÄÖ§³Ö£¬µ«ÊÇĬÈÏ°²×°µÄJDK»òÕßJREÊDz»ÄÜÖ§³Öaes192bitÃÜÔ¿ºÍaes256bitÃÜÔ¿Á½ÖÖËã·¨µÄ£¬ÐèÒªµ½sun¹Ù·½ÏÂÔØJava(TM) Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files£¬ÒÔÏÂÊÇjce unilimited strength jurisdiction policy files 6µÄ¹Ù·½ ......
ѧϰJavaÀàµÄÊôÐÔ-Î人±±´óÇàÄñ
¡¡¡¡Public¡¢private¡¢protectedÏÔʾÁËÈýÖÖÀàÖеÄÊôÐԺͷþÎñµÄÀàÐÍ£¬publicÊÇ¿ÉÒÔËæÒâ·ÃÎʵġ¢privateÊÇÍâ½ç²»ÄÜ·ÃÎʵÄ(ÏÔʾÁËÊý¾ÝµÄ·â×°ÐÔ)¡¢protected˵Ã÷Êý¾ÝÊÇÊܱ£»¤µÄ¡£ÏÂÃæ¾ÍÀ´Ïêϸ½²ÊöÒ»ÏÂÕâÈý¸ö¾¿¾¹ÓÐʲôÇø±ð¡£
¡¡¡¡Ê×ÏÈÒªÁ˽âһϰüµÄ¸ÅÄî¡£ÓÐÈô¸É¸öÀ࣬ËüÃÇÏ໥֮¼äÓÐÒ»¶¨µÄ¹ØÏ ......
ÎÊÌâÒ»£ºÈç±£¼ÓÔØJDBCÇý¶¯³ÌÐò£º
Õý³£ÎÒÃǼÓÔØÇý¶¯³ÌÐòÓÐÈý¸ö;¾¶£º
1.Class.forName(String)ÕâÏëµ±ÓÚclassLoaderÒ»¸öStringÖ¸¶¨µÄÀ࣬ÔÚ×°ÔØʱ°Ñ¸ÃÇý¶¯³ÌÐòµÄ¾²Ì¬ÄÚÈݶ¼³õʼ»¯£¬ÆäʵÕâʱÇý¶¯³ÌÐòÀàµ÷ÓÃÁËDriverManager.registerDriver(driver)·½·¨¡£
2.ʹÓÃϵͳÊôÐÔ£ºSystem.getPro ......