¹ØÓÚJavaµÄ¼¸¸öÎÊÌâ
×î½üÃæÊÔÁ˺ܶ๫˾£¬Ò»Ð©±ÊÊÔºÍÃæÊÔµÄÎÊÌâÈÃÎÒÉîÓид¥¡£ËäȻ˵×Ô¼º¶ÔJavaÒѾºÜÊìϤÁË£¬²»¹ýµ±Ãæ¶ÔһЩϸ½ÚµÄʱºò£¬×Ô¼ºÈ·ÊµÓеãÎÞ´ÓÏÂÊÖ¡£ÏÂÃæ¼òµ¥µÄÁоټ¸¸öÀý×Ó£º
1.JavaÖжѺÍÕ»µÄÇø±ð
Æäʵ£¬Õâ¸öÎÊÌâ²¢²»ÊǺÜÄÑ¡£²»¹ýÒ²ÐíºÜ¶à³ÌÐòÔ±ÍùÍùºöÂÔÁËÕâÒ»µã£¬ÓÈÆäÊÇÔÚÀ¬»ø»ØÊÕµÄʱºò¡£´ó¼Ò¿ÉÄÜÏ°¹ßÁËJavaµÄGC»úÖÆ£¬ÆäʵÈç¹ûÄÜ×ÐϸÀí½âGC£¬ÎÒÃÇÍêÈ«¿ÉÒÔÌá¸ßÖ´ÐгÌÐòµÄЧÂÊ¡£ÄÇô¶ÑºÍÕ»¾ÍÊÇ×î»ù±¾µÄ¶«Î÷¡£
¶ÑºÍÕ»¶¼ÊÇJavaÓÃÀ´ÔÚÄÚ´æ´æ·ÅÊý¾ÝµÄµØ·½¡£
¼òµ¥µÄÀ´Ëµ£¬ÓÃnew´´½¨µÄ¶ÔÏ󣬼´ÔËÐÐʱ¶¯Ì¬µÄ·ÖÅäÄڴ棬´æÔÚ¶ÑÖС£¶ÑÊÇÓÉÀ¬»ø»ØÊÕÀ´¸ºÔðµÄ£¬¶ÑµÄÓÅÊÆÊÇ¿ÉÒÔ¶¯Ì¬µØ·ÖÅäÄÚ´æ´óС£¬JavaµÄÀ¬»øÊÕ¼¯Æ÷»á×Ô¶¯ÊÕ×ßÕâЩ²»ÔÙʹÓõÄÊý¾Ý¡£
ΪÁËÌá¸ß³ÌÐòµÄЧÂÊ£¬µ±ÎÒÃDz»ÐèҪʹÓÃÕâ¸ö¶ÔÏóʱ£¬Ö»Òª¼òµ¥Í£Ö¹¶ÔËüµÄÒýÓü´¿É£¬¼´°ÑÕâ¸ö¶ÔÏó¸³ÖµÎªNULL£¬¶ø²»ÊǵÈÀ¬»ø»ØÊÕÕ¾ÂýÂýµÄ»ØÊÕ¡£
¶øJavaµÄһЩ»ù±¾Êý¾ÝÀàÐͺÍÒýÓÃÒ»°ã´æÔÚÕ»ÖС£Õ»µÄ´æÈ¡ËٶȺܿì¶øÇÒÕ»ÖеÄÊý¾Ý¿ÉÒÔ¹²Ïí¡£
2.JavaÖÐsleepºÍwaitµÄÇø±ð
Èç¹ûÄãûÓÐÓùýÏ̻߳òºÜÉÙÓõ½Ị̈߳¬Õâ¸öÎÊÌ⻹ÕæµÄ²»ºÃ»Ø´ð£¬¶øÇÒºÜÈÝÒ×»ìÏý¡£
Ê×ÏÈ£¬¶þÕ߶¼ÊÇʹÏß³ÌÔÝʱִֹͣÐеķ½·¨¡£µ«ÊǶþÕßÈ´ÓֺܴóµÄ²»Í¬¡£
×î»ù´¡µÄÒ»µã¾ÍÊÇsleepÊÇThreadÖеķ½·¨£¬¶øwaitÊÇObjectÖеķ½·¨¡£
sleepÊÇʹµ±Ç°Ïß³ÌÔÝʱ˯Ãߣ¬¿ÉÒÔ·ÅÔÚÈκÎλÖ᣶øwaitÊÇʹµ±Ç°Ïß³ÌÔÝʱ·ÅÆú¶ÔÏóµÄʹÓÃȨ½øÐеȴý£¬±ØÐë·ÅÔÚͬ²½·½·¨»òͬ²½¿éÀï¡£sleepʹÓõÄʱºò£¬Ï̲߳¢²»»á·ÅÆú¶ÔÏóµÄʹÓÃȨ£¬¼´²»»áÊͷŶÔÏóËø£¬ËùÒÔÔÚͬ²½·½·¨»òͬ²½¿éÖÐʹÓÃsleep£¬Ò»¸öÏ̷߳ÃÎÊʱ£¬ÆäËûµÄÏß³ÌÒ²ÊÇÎÞ·¨·ÃÎʵġ£¶øwaitÊÇ»áÊͷŶÔÏóËøµÄ£¬¾ÍÊǵ±Ç°Ï̷߳ÅÆú¶ÔÏóµÄʹÓÃȨ£¬ÈÃÆäËûµÄÏ߳̿ÉÒÔ·ÃÎÊ¡£Ïß³ÌÖ´ÐÐwait·½·¨Ê±£¬ÐèÒªÁíÒ»¸öÏ̵߳÷Óà notify½øÐл½ÐÑ¡£¶øsleepÖ»ÊÇÔÝʱÐÝÃßÒ»¶¨Ê±¼ä£¬Ê±¼äµ½ÁËÖ®ºó£¬×Ô¶¯»Ö¸´ÔËÐУ¬²»ÐèÁíÍâµÄÏ̻߳½ÐÑ¡£
¼òµ¥µÄÀ´Ëµ£¬sleepÖ»ÊÇÔÝʱÐÝÃ߶øÒÑ¡£¶øwaitÔòͨ³£ÓÃÓëÏß³Ìͬ²½£¬¾³£ÓënotifyºÍnotifyAllʹÓá£
3.ÄãÌý¹ýµÄJavaµÄÉè¼ÆÄ£Ê
Ïà¹ØÎĵµ£º
1:¿¼ÂÇʹÓþ²Ì¬¹¤³§·½·¨´úÌæ¹¹¹¹·½·¨À´ÊµÀý»¯Àà¡£
2£ºÊ¹ÓÃ˽Óù¹¹¹º¯Êý£¬Ê¹Àà¾ßÓв»¿ÉʵÀý»¯µÄÄÜÁ¦¡£
3£º±ÜÃâ´´½¨Öظ´µÄ¶ÔÏó
4£ºÏû³ý¹ýÆڵĶÔÏóµÄʹÓÃ
5£º±ÜÃâʹÓÃÖսắÊý
6£ºÊ¹ÀàºÍ³ÉÔ±µÄ¿É·ÃÎÊÐÔ×îС
7£º½Ó¿ÚÓÅÏÈÓÚ³éÏó
8£ºÎªËùÓеIJÎÊý½øÐÐÓÐЧÐÔ¼ì²é
9£º½÷É÷ʹÓÃÖØÔØ
10£ºÊ¹ÓÃ0³¤¶ÈµÄÊý×飬¶ø²»ÊÇ¿Õ
11£º½«¾ ......
JavaÐéÄâ»úĬÈÏ·ÖÅä64MÄڴ棬Èç¹ûÄãµÄÓ¦ÓñȽϴ󣬳¬³ö64MÄڴ棬JavaÐéÄâ»ú¾Í»áÅ׳öOutOfMemoryError£¬²¢Í£Ö¹ÔËÐС£²»¹ÜÊÇʲôӦÓã¨WebÓ¦Óá¢ApplicationµÈ£©£¬Ö»ÐèÒªÐÞ¸ÄÄãµÄ»úÆ÷ÉϵÄÔËÐÐJavaÃüÁÔÚjava xxxÃüÁîÖÐÌí¼Ó-Xms(×îСʹÓÃÄÚ´æ)¡¢-Xmx£¨×î´óʹÓÃÄڴ棩¼´¿É½â¾ö¡£µ±È»£¬Õâ¶ùµÄÄÚ´æÈÝÁ¿¶¼ÊÇÖ¸ÎïÀíÄڴ棬²»Ä ......
JavaÖÐÌṩÁ˷ḻµÄÈÕÆÚ±íʾ·½Ê½¡£ÆäÖаüÀ¨Date¡¢Timestamp¡¢Calendar¡¢GregorianCalendarÀà¡£GregorianCalendarÀàÖÐÌṩÁËÓÃÓÚ¼ÆËãÈÕÆÚµÄadd()·½·¨£¬¿ÉÒԺܷ½±ãµØ¼ÆËãÈô¸ÉÄê¡¢Ô¡¢ÈÕºóµÄÈÕÆÚ¡£
¸ø¸öÀý×Ó¿´¿´£º
package testjava;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import ......
Ê×ÏȵÃÏÂÔØÇý¶¯³ÌÐòµ½Î¢ÈíÍøÕ¾ÏÂÔØMicrosoft SQL Server 2005 JDBC Driver 1.2
½âѹMicrosoft SQL Server 2005 jdbc driver1.2.exe£¬°Ñsqljdbc_1.1¸´ÖƵ½%ProgramFiles%£¨Èç¹ûϵͳÔÚCÅÌÔòΪC:\Program Files£©¡£
ÉèÖÃ Classpath
JDBC Çý¶¯³ÌÐò²¢Î´°üº¬ÔÚ Java SDK ÖС£Òò´Ë£¬Èç¹ûҪʹÓøÃÇý¶¯³ÌÐò£¬±ØÐ뽫 classpath ......
×î½üÑо¿ÏÂsocket,ctrl+vÁËÏÂÍøÉϵĶ«Î÷:
ÊÂʵÉÏÍøÂç±à³Ì¼òµ¥µÄÀí½â¾ÍÊÇÁ½Ì¨¼ÆËã»úÏ໥ͨѶÊý¾Ý¶øÒÑ¡£¶ÔÓÚ³ÌÐòÔ±¶øÑÔ£¬È¥ÕÆÎÕÒ»ÖÖ±à³Ì½Ó¿Ú²¢Ê¹ÓÃÒ»ÖÖ±à³ÌÄ£ÐÍÏà¶Ô¾Í»áÏԵüòµ¥µÄ¶àÁË¡£Java SDKÌṩһЩÏà¶Ô¼òµ¥µÄApiÀ´Íê³ÉÕâЩ¹¤×÷£¬Socket¾ÍÊÇÆäÖÐÖ®Ò»¡£
¡¡¡¡¶ÔÓÚJava¶øÑÔ¡£ÕâЩApi´æÔÚÓëJava.netÕâ¸ö ......