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

JavaÖÐÈçºÎÕýȷʹÓÃ×ÖÌå±àÂë

Ê×ÏÈÉùÃ÷һϣ¬´ËÎÄÕÂʱ´ÓÍøÉÏתÔصġ£ÈçϵÄijЩ·½·¨ÊÇȷʵ¹ÜÓ㬵«ÊÇ´ÓÖз¢ÏÖÁËÓÐÒ»µã²»×㣬¾ÍÊÇÔ­ÎıÊÕßû¿¼ÂÇʹÓò»Í¬Web
Serverʱ³öÏÖµÄÇé¿ö£¬±ÈÈçÎÄÕÂÀïÎÒÓÃ
ºìÉ«×ÖÌå
»­³öÀ´µÄ²¿·Ö´úÂëÔÚTomcatÅܵÄʱºòµÃÓÃËû˵µÄ·½·¨£¬²»¹ýµ½ÁËWebSphereµÄʱºò±ØÐëµÃÓÃÔ­ÏȵÄ
String name = request.getParameter("name");
ËùÒÔ²ÉÈ¡±¾ÎÄ·½·¨µÄʱºò²»ÒªÌ«ËÀ°å£¬¶àÊÔÊÔ¡£
ÔÚJava
±à³ÌÖУ¬ÖÐÎÄ×ÖÌå±àÂëÄѵ¹Á˲»ÉÙ³ÌÐòÔ±£¬Èç¹ûץסÁËÓ°ÏìJava
ÖÐÎÄÏÔʾµÄ¼¸¸ö¹Ø¼üÒòËØ£¬ÎÊÌ⽫ӭÈжø½â¡£
Java
ÊÇÄ¿Ç°×îÁ÷ÐеÄÃæÏò¶ÔÏóµÄ±à³ÌÓïÑÔÖ®Ò»£¬Java
Ö§³ÖUTF-8¡¢ISO-8859-1¡¢GBKµÈ¸÷ÖÖ×ÖÌå±àÂ룬¿ÉÊÇ·¢ÏÖJava
ÖÐ×ÖÌå±àÂëµÄÎÊÌâÈÔÄѵ¹Á˲»ÉÙ³ÌÐòÔ±£¬ÍøÉÏËäȻҲÓв»ÉÙ¹ØÓÚÔÚJava
ÖÐÈçºÎÕýÈ·ÏÔʾÖÐÎĵÄÎÄÕ£¬µ«¶¼²»¹»È«Ã棬ÌØÒâ×ܽáÈçÏ¡£
Ó°ÏìJava
ÖÐ×ÖÌå±àÂëÕýÈ·ÏÔʾµÄÓм¸¸öÒòËØ:
1)Êý¾Ý¿âµÄÁ¬½Ó·½Ê½;
2)ÍøÒ³ÖÐʹÓõÄ×ÖÌå±àÂë;
3)Êý¾Ý¿âÀï´æ·ÅÊý¾ÝµÄ×ÖÌå±àÂë;
4)Java
µÄȱʡ×ÖÌå±àÂë¡£
Èç¹ûÔÚ±à³ÌÖÐÓöµ½²»ÄÜÕýÈ·ÏÔʾÖÐÎÄʱ£¬ÒªÏÈŪÇå³þÒÔÉϼ¸ÏîËùʹÓõÄ×ÖÌå±àÂ룬ÔÙ·ÖÎöÕÒ³öÔ­Òò£¬¼´¿É½â¾öÎÊÌâ¡£
ÖÚËùÖÜÖª£¬JSPÊÇJava
µÄÒ»ÖÖ£¬ºÍÍøÒ³Óйأ¬¶øÍøÒ³Ò²ÓÐ×Ô¼ºµÄÖÐÎıàÂëϵͳ£¬ËùÒÔJSP´¦ÀíÖÐÎÄÒª±È´¿Java
µÄÀàÎļþ¸üΪÂé·³¡£±¾ÎĵIJâÊÔÊý¾Ý¿âÊÇMySQL3.2£¬Êý¾Ý¿âÁ¬½ÓÇý¶¯ÊÇÓÃorg.gjt.mm.mysql.Driver£¬ÕâÀïÖ÷ÒªÌÖÂÛUTF-8ºÍGBKµÄÏÔʾ(
GB2312ÊÇGBKµÄÒ»¸ö×Ó¼¯£¬Java
ÖпÉÒÔʹÓÃGBKÀ´´úÌæGBϵÁÐ)¡£ÎÒÃÇÏÈÀ´Ñо¿JSPÖÐ×ÖÌå±àÂëÎÊÌ⣬
ÏÂÃæµÚÒ»µ½µÚÁùµãÊÇÕë¶ÔJSPµÄ(ÒòΪ´ÓÊý¾Ý¿âÀï¶Á³öÖÐÎÄÊý¾ÝÓëдÈëÖÐÎÄÊý¾ÝÓÐËùÇø±ð£¬ÔÛÃÇ·Ö±ð˵Ã÷£¬Ç°ÈýµãÊÇ´Ó¶ÁÈ¡Êý¾Ý¿âµ½ÏÔʾÔÚÍøÒ³£¬ºóÈýµãÊÇ´ÓÍøÒ³ÊäÈëÊý¾Ýµ½´æÈëÊý¾Ý¿â)£¬µÚÆßµ½µÚ¾ÅµãÕë¶Ô´¿Java
µÄÀàÎļþ¡£ ÒÔÏÂrs±íʾResultSetµÄÒ»¸öʵÀý£¬ÊÇÖ´ÐÐSelectÓï¾äÖ®ºó²úÉúµÄÊý¾Ý¼¯¡£
Ò»¡¢Êý¾Ý¿âÁ¬½Ó·½Ê½Ê¹ÓÃUTF-8
ÔÚÁ¬½ÓÊý¾Ý¿âµÄÇý¶¯ºóÃæ¼ÓÉÏÕâ¾ä²ÎÊý
useUnicode=true&characterEncoding=UTF-8
ÀýÈç:
jdbc:mysql://localhost/DBVF?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
´ÓÊý¾Ý¿âÀï¶Á³öÖÐÎÄÏÔʾÔÚʹÓÃGBKµÄJSPµÄÍøÒ³ÀÈç¹ûÊý¾Ý¿âÀï´æ·ÅµÄ×ÖÌå±àÂëÊÇUTF-8£¬ÔÚJSPÖÐʹÓÃ
str=new
String(rs.getBytes(1),"UTF-8");
»òÕß
str=rs.getString(1);
¿ÉÒÔÕýÈ·ÏÔʾÖÐÎÄ¡£
Èç¹ûÊý¾Ý¿âÀï´æ·ÅµÄÊÇGBKÊý¾Ý£¬ÄÇôJSPÖÐҲҪʹÓÃ
str=new Strin


Ïà¹ØÎĵµ£º

java ¼¸ÖÖÅÅÐòËã·¨


//ÅÅÐòºÍ²éÕÒÊÇÊý¾Ý½á¹¹ÓëËã·¨Éè¼ÆµÄÖØÒªÄÚÈÝ
/*
ÅÅÐòÖ÷Òª°üÀ¨
1.²åÈëÅÅÐò£ºÓÖ°üÀ¨Ö±½Ó²åÈëÅÅÐò¡¢¶þ·Ö·¨²åÈëÅÅÐò¡¢±í²åÈëÅÅÐò¡¢ShellÅÅÐò
2.Ñ¡ÔñÅÅÐò£º°üÀ¨Ö±½ÓÑ¡ÔñÅÅÐò¡¢¶ÑÅÅÐò
3.½»»»ÅÅÐò£ºÃ°ÅÝÅÅÐò¡¢¿ìËÙÅÅÐò
4.·ÖÅäÅÅÐò£ºÖ÷ÒªÓлùÊýÅÅÐò
5.¹é²¢ÅÅÐò£ºÖ÷ÒªÓÐÄÚÅÅÐò¡¢ÍâÅÅÐò
×¢£ºÒÔϳÌÐò¾ùÔÚ±¾È˵çÄÔÉÏͨ¹ýÍêÕ ......

JavaÔ¶³ÌͨѶ¿ÉÑ¡¼¼Êõ¼°Ô­Àí

ÔÚ·Ö²¼Ê½·þÎñ¿ò¼ÜÖУ¬Ò»¸ö×î»ù´¡µÄÎÊÌâ¾ÍÊÇÔ¶³Ì·þÎñÊÇÔõôͨѶµÄ£¬ÔÚJavaÁìÓòÖÐÓкܶà¿ÉʵÏÖÔ¶³ÌͨѶµÄ¼¼Êõ£¬ÀýÈ磺RMI¡¢MINA¡¢ESB¡¢ Burlap¡¢Hessian¡¢SOAP¡¢EJBºÍJMS µÈ£¬ÕâЩÃû´ÊÖ®¼äµ½µ×ÊÇЩʲô¹ØϵÄØ£¬ËüÃDZ³ºóµ½µ×ÊÇ»ùÓÚʲôԭÀíʵÏÖµÄÄØ£¬Á˽âÕâЩÊÇʵÏÖ·Ö²¼Ê½·þÎñ¿ò¼ÜµÄ»ù´¡ÖªÊ¶£¬¶øÈç¹ûÔÚÐÔÄÜÉÏÓиߵÄÒªÇóµÄ»°£¬Ä ......

JavaỊ̈߳ºÏß³ÌջģÐÍÓëÏ̵߳ıäÁ¿

JavaỊ̈߳ºÏß³ÌջģÐÍÓëÏ̵߳ıäÁ¿
 
SCJP5ѧϰ±Ê¼Ç
 
ÒªÀí½âÏ̵߳÷¶ÈµÄÔ­Àí£¬ÒÔ¼°Ïß³ÌÖ´Ðйý³Ì£¬±ØÐëÀí½âÏß³ÌջģÐÍ¡£
Ïß³ÌÕ»ÊÇָijʱ¿ÌʱÄÚ´æÖÐÏ̵߳÷¶ÈµÄÕ»ÐÅÏ¢£¬µ±Ç°µ÷Óõķ½·¨×ÜÊÇλÓÚÕ»¶¥¡£Ïß³ÌÕ»µÄÄÚÈÝÊÇËæ×ųÌÐòµÄÔËÐж¯Ì¬±ä»¯µÄ£¬Òò´ËÑо¿Ïß³ÌÕ»±ØÐëÑ¡ÔñÒ»¸öÔËÐеÄʱ¿Ì£¨Êµ¼ÊÉÏÖ¸´úÂëÔËÐе½Ê²Ã´µØ· ......

JavaỊ̈߳ºÏ̵߳ĵ÷¶È ÊØ»¤Ïß³Ì

JavaỊ̈߳ºÏ̵߳ĵ÷¶È-ÊØ»¤Ïß³Ì
 
ÊØ»¤Ïß³ÌÓëÆÕͨÏß³Ìд·¨ÉÏ»ù±¾Ã´É¶Çø±ð£¬µ÷ÓÃÏ̶߳ÔÏóµÄ·½·¨setDaemon(true)£¬Ôò¿ÉÒÔ½«ÆäÉèÖÃΪÊØ»¤Ï̡߳£
 
ÊØ»¤Ïß³ÌʹÓõÄÇé¿ö½ÏÉÙ£¬µ«²¢·ÇÎÞÓ㬾ÙÀýÀ´Ëµ£¬JVMµÄÀ¬»ø»ØÊÕ¡¢ÄÚ´æ¹ÜÀíµÈÏ̶߳¼ÊÇÊØ»¤Ï̡߳£»¹ÓоÍÊÇÔÚ×öÊý¾Ý¿âÓ¦ÓÃʱºò£¬Ê¹ÓõÄÊý¾Ý¿âÁ¬½Ó³Ø£¬Á¬½Ó³Ø±¾ÉíÒ²°üº ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ