java¿ª·¢ÖÐMysqlÖÐÎÄÂÒÂëÎÊÌâµÄ½â¾ö
MysqlÔÚĬÈÏÇé¿öϽ¨Á¢±íµÄ×Ö·û±àÂëÊÇlatin1£¬ËùÒÔÔÚ²åÈëÖÐÎÄʱ»á³ö´í¡£
eg£º
1¡¢²é¿´±í½¨Á¢µÄsqlÔ´Â룺
1: sqlÃüÁshow create table users
2:
3: ½á¹û£º
4: CREATE TABLE `users` (
5: `userID` int(10) unsigned NOT NULL AUTO_INCREMENT,
6: `userName` varchar(45) NOT NULL,
7: `password` varchar(45) NOT NULL,
8: PRIMARY KEY (`userID`)
9: ) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=latin1
2¡¢²é¿´±íÖи÷ÁеÄÊôÐÔ£º
ÃüÁshow full columns from users
½á¹û£º
ÆäÖÐCollationÁбíʾ×Ö·û±àÂë¡£
½â¾ö·½·¨£º
Ò»¡¢ÐÞ¸ÄmysqlµÄÅäÖÃÎļþ£º
ÔÚmysqlµÄ°²×°Ä¿Â¼£¨C:\Program Files\MySQL\MySQL Server 5.1£©Ï£¬ÐÞ¸Ämy.ini¡£
²éÕÒdefault-character-setÊôÐÔ£¬½«Á½´¦¶¼¸ÄΪGBK¡£ÒÔºóÔÙ½¨±íʱ½«Ä¬ÈÏΪGBK±àÂ뷽ʽ¡£
ÐèÒªÖØÐÂÆô¶¯mysql·þÎñ¡£
¶þ¡¢Ð޸ıíµÄ×Ö·û±àÂëÊôÐÔ£º
ÃüÁalter table users CONVERT TO CHARACTER SET gbk
ÃüÁîÔËÐк󣬱íµÄÊôÐÔCHARSET=GBK£¬userNameºÍPasswordÁеÄCollationÊôÐÔ±äΪgbk_chinese_ci¡£
Èý¡¢ÐÞ¸ÄservletÖеĴúÂ룺
ÔÚservlet»ñÈ¡´«¹ýÀ´µÄ²ÎÊý֮ǰÉèÖñàÂ뷽ʽ£¬Èç:
request.setCharacterEncoding("gbk");
String msgTitle = request.getParameter("msgTitle");
String msgContent = request.getParameter("msgContent");
Ïà¹ØÎĵµ£º
MD5¼´Message-Digest Algorithm 5£¨ÐÅÏ¢-ÕªÒªËã·¨5£©£¬ÊÇÒ»ÖÖÓÃÓÚ²úÉúÊý×ÖÇ©ÃûµÄµ¥ÏîÉ¢ÁÐËã·¨£¬ÔÚ1991ÄêÓÉMIT Laboratory for Computer Science£¨IT¼ÆËã»ú¿ÆÑ§ÊµÑéÊÒ£©ºÍRSA Data Security Inc£¨RSAÊý¾Ý°²È«¹«Ë¾£©µÄRonald L. Rivest½ÌÊÚ¿ª·¢³öÀ´£¬¾ÓÉMD2¡¢MD3ºÍMD4·¢Õ¹¶øÀ´¡£MD5Ëã·¨µÄʹÓò»ÐèÒªÖ§¸¶ÈκΰæÈ¨·ÑÓá£ËüµÄ×÷ ......
ÔÚJavaÖУ¬²»Í¬µÄÀà¶¼ÓÐ×Ô¼ºµ¥¶ÀµÄCache»úÖÆ£¬ÊµÏֵķ½·¨Ò²¿ÉÄÜÓÐËù²»Í¬£¬ÎÄÕÂÁоÙÁËJavaÖг£¼ûµÄ¸÷ÀàCache»úÖÆµÄʵÏÖ·½·¨£¬Í¬Ê±½øÐÐÁË×ۺϵıȽϡ£
OSCache
OSCacheÊǸöÒ»¸ö¹ã·º²ÉÓõĸßÐÔÄܵÄJava EE»º´æ¿ò¼Ü£¬OSCacheÄÜÓÃÓÚÈκÎJavaÓ¦ÓóÌÐòµÄÆÕͨµÄ»º´æ½â¾ö·½°¸¡£
OSCacheÓÐÒÔÏÂÌØµã£º»º´æÈκζÔÏó£¬Äã¿ÉÒÔ²»ÊÜÏÞÖÆµ ......
ÔÚJavaÖУ¬²»Í¬µÄÀà¶¼ÓÐ×Ô¼ºµ¥¶ÀµÄCache»úÖÆ£¬ÊµÏֵķ½·¨Ò²¿ÉÄÜÓÐËù²»Í¬£¬ÎÄÕÂÁоÙÁËJavaÖг£¼ûµÄ¸÷ÀàCache»úÖÆµÄʵÏÖ·½·¨£¬Í¬Ê±½øÐÐÁË×ۺϵıȽϡ£
OSCache
OSCacheÊǸöÒ»¸ö¹ã·º²ÉÓõĸßÐÔÄܵÄJava EE»º´æ¿ò¼Ü£¬OSCacheÄÜÓÃÓÚÈκÎJavaÓ¦ÓóÌÐòµÄÆÕͨµÄ»º´æ½â¾ö·½°¸¡£
OSCacheÓÐÒÔÏÂÌØµã£º»º´æÈκζÔÏó£¬Äã¿ÉÒÔ²»ÊÜÏÞÖÆµ ......
ΪÁË×öµ½Ê¹µÃ³ÌÐò¾ßÓиü¸ßµÄÁé»îÐÔ£¬¿ÉÅäÖÃÐÔ£¬ÔÚ¿ª·¢ÖÐÎÒÃǾ³£ÀûÓ÷´ÉäÀ´´´½¨Ò»¸öÀàµÄʵÀý£¬Ò²¾ÍÊÇ»ñµÃÒ»¸öÀàµÄÒ»¸ö¶ÔÏó£¡Í¨³£µÄ×ö·¨ÊÇͨ¹ýclass.newInstance»ñµÃ£»µ«ÕâÖÖ·½·¨ÓÐÒ»¸ö²»ºÃµÄµØ·½£¬ÄǾÍÊÇËûÖ»ÄÜ´´½¨Î޲ι¹ÔìÆ÷µÄ¶ÔÏó£¬Èç¹û¹¹ÔìÆ÷ÓвÎÊýÄÇËüÊÇÎÞÄÜΪÁ¦µÄ£»½â¾öµÄ·½·¨¾ÍÊÇ ÏÈͨ¹ý¸ÃÀàµÄClass»ñµÃ´øÓвΠ......