Java½âÎöÍøÂçÊý¾ÝÁ÷µÄÈýÖÖÌØÊâ·½·¨
Ò»¡¢UTF8ת»»³ÉGB2312
µ±ÎÒÃÇÔÚ»ùÓÚHTTPÐÒéµÄJSP»òServletµÄÓ¦ÓÃÖлñÈ¡Êý¾Ý»ò·¢ËÍÇëÇóʱ£¬JVM»á°ÑÊäË͵ÄÊý¾Ý±àÂë³ÉUTF8¸ñʽ¡£Èç¹ûÎÒÃÇÖ±½Ó´ÓHTTPÁ÷ÖÐÌáÈ¡ÖÐÎÄÊý¾Ý£¬ÌáÈ¡µÄ½á¹ûΪ“????”£¨¿ÉÄܸü¶àÎʺţ©£¬Îª×ª»»³ÉÎÒÃÇÄܹ»Àí½âµÄÖÐÎÄ×Ö·û£¬ÎÒÃÇÐèÒª°ÑUTF8ת»»³ÉGB2312£¬½èÖúISO-8859-1±ê×¼±àÂëÄܹ»ÇáÒ×µÄʵÏÖ£¬ÏÂÃæµÄ´úÂëʵÏÖÁËÕâÒ»¹¦ÄÜ£º
byte [] b;
String utf8_value;
utf8_value = request.getParameter("NAME");//´ÓHTTPÁ÷ÖÐÈ¡"NAME"µÄUTF8Êý¾Ý
b = utf8_value.getBytes("8859_1"); //ÖмäÓÃISO-8859-1¹ý¶É
String name = new String(b, "GB2312"); //ת»»³ÉGB2312×Ö·û
ʵ¼ÊÉÏ£¬¹À¼Æ»¹µÃ¿´Ò³ÃæµÄ±àÂ뷽ʽ£¬Ã»Ê±¼ä²âÊÔ....
¶þ¡¢ÔÚÖªµÀÁ÷³¤¶ÈµÄÇé¿öϽ«ÊäÈëÁ÷ת»»³É×Ö½ÚÊý×é
JavaÖеÄÊäÈëÁ÷³éÏóÀàInputStreamÓÐint read(byte[] b, int off, int len)·½·¨£¬²ÎÊýÖÐbyte[] bÊÇÓÃÀ´´æ·Å´ÓInputStreamÖжÁÈ¡µÄÊý¾Ý,int offÖ¸¶¨Êý×ébµÄÆ«ÒƵØÖ·£¬Ò²¾ÍÊÇÊý×ébµÄÆðʼϱ꣬int lenÖ¸¶¨ÐèÒª¶ÁÈ¡µÄ³¤¶È£¬·½·¨·µ»Øʵ¼Ê¶ÁÈ¡µÄ×Ö½ÚÊý¡£¸ÕѧJavaµÄÅóÓÑ¿ÉÄÜҪ˵£ºÏȶ¨ÒåÒ»¸öÓëÁ÷³¤¶ÈµÈ³¤µÄ×Ö½ÚÊý×飬µ÷ÓÃread·½·¨£¬Ö¸¶¨ÆðʼϱêΪ0£¬Ö¸¶¨¶ÁÈ¡³¤¶ÈÓëÊý×鳤¶ÈµÈ³¤£¬²»ÊÇÒ»ÏÂ×Ó¿ÉÒÔ¶Á³öÀ´ÁËÂð£¿ËµµÄû´í£¬±ÊÕßÔø¾Ò²ÊÔ×ÅÕâÑù¶ÁÈ¡Êý¾Ý£¬µ«ºóÀ´·¢ÏÖÔÚ¶ÁÈ¡ÍøÂçÊý¾ÝʱºÜ²»°²È«£¬ÎÒÃÇÏëÏëÔÚÍøÂçÉÏ»ñÈ¡Êý¾Ý¿ÉÄܲ¢Ã»ÄÇôÁ÷³©£¬Êý¾ÝÁ÷µÄ´«ËÍ¿ÉÄÜ»á¶Ï¶ÏÐøÐø£¬ËùÒÔ²¢²»Äܱ£Ö¤Ò»´Î¾ÍÄܶÁÈ¡È«²¿Êý¾Ý£¬ÌرðÊÇÔÚ¶ÁÈ¡´óÈÝÁ¿Êý¾Ýʱ¸üÊÇÈç´Ë£¬ËùÒÔÎÒÃDZØÐëÔÚ¶ÁÈ¡Êý¾Ýʱ¼ì²âʵ¼Ê¶Áµ½µÄ³¤¶È£¬Èç¹ûûÓжÁÍêÒÑÖª³¤¶ÈµÄÊý¾Ý¾ÍÓ¦¸ÃÔٴζÁÈ¡£¬ÒÔ´ËÑ»·¼ì²â£¬Ö±µ½Êµ¼Ê¶ÁÈ¡µÄ³¤¶ÈÀÛ¼ÓÓëÒÑÖªµÄ³¤¶ÈÏàµÈ£¬ÏÂÃæµÄ´úÂëʵÏÖÁËÕâÒ»¹¦ÄÜ£º
ServletInputStream inStream = request.getInputStream(); //È¡HTTPÇëÇóÁ÷
int size = request.getContentLength(); //È¡HTTPÇëÇóÁ÷³¤¶È
byte[] buffer = new byte[size]; //ÓÃÓÚ»º´æÿ´Î¶ÁÈ¡µÄÊý¾Ý
byte[] in_b = new byte[size]; //ÓÃÓÚ´æ·Å½á¹ûµÄÊý×é
int count = 0;
int rbyte = 0;
while (count < size) { //Ñ»·¶ÁÈ¡
rbyte = inStream.read(buffer); //ÿ´Îʵ¼Ê¶ÁÈ¡³¤¶È´æÓÚrbyteÖÐ
for(int i=0;i < rbyte ; i++){
in_b[count + i] = buffer[i];
}
count += rbyte;
}
Èý¡¢ÔÚ²»ÖªµÀÁ÷³¤¶È
Ïà¹ØÎĵµ£º
Windows->Preference->Java->Code Style->Code Templates->Code->New Java file->Edit
ÔÀ´µÄÄ£°å£º
${filecomment}
${package_declaration}
${typecomment}
${type_declaration}
Ð޸ĺó£º
${filecomment}
${package_declaration}
/**
* @author Xing,Ming
* @version ${date} ${time}
* ......
ÎÒÃÇÔÚ½øÐÐpl/sql±à³Ìʱ´ò½»µÀ×î¶àµÄ¾ÍÊÇ´æ´¢¹ý³ÌÁË¡£´æ´¢¹ý³ÌµÄ½á¹¹ÊǷdz£µÄ¼òµ¥µÄ£¬ÎÒÃÇÔÚÕâÀï³ýÁËѧϰ´æ´¢¹ý³ÌµÄ»ù±¾½á¹¹Í⣬»¹»áѧϰ±àд´æ´¢¹ý³ÌʱÏà¹ØµÄһЩʵÓõÄ֪ʶ¡£È磺ÓαêµÄ´¦Àí£¬Òì³£µÄ´¦Àí£¬¼¯ºÏµÄÑ¡ÔñµÈµÈ
1.´æ´¢¹ý³Ì½á¹¹
1.1 µÚÒ»¸ö´æ´¢¹ý³Ì
create or replace procedure proc1(
  ......
3.3 ÓαêÑ»·×î¼Ñ²ßÂÔ
ÎÒÃÇÔÚ½øÐÐPL/SQL±à³Ìʱ£¬¾³£ÐèҪѻ·¶ÁÈ¡½á¹û¼¯µÄÊý¾Ý¡£½øÐÐÖðÐд¦Àí£¬Õâ¸ö¹ý³Ì¾ÍÐèÒª¶ÔÓαê½øÐÐÑ»·¡£¶ÔÓαê½øÐÐÑ»·µÄ·½·¨ÓжàÖÖ£¬ÎÒÃÇÔÚ´ËÒ»Ò»·ÖÎö¡£
create or replace procedure proccycle(p varchar2)
as
cursor c_postype is select pos_type, description ......
ÅäÖÃjava»·¾³±äÁ¿£º JAVA_HOME£ºÅäÖÃJDKµÄĿ¼ CLASSPATH£ºÖ¸¶¨µ½ÄÄÀïÈ¥ÕÒÔËÐÐʱÐèÒªÓõ½µÄÀà´úÂ루×Ö½ÚÂ룩 PATH£ºÖ¸¶¨¿ÉÖ´ÐгÌÐòµÄλÖà LINUXϵͳ£¨ÔÚ" .bash_profile "ϵĻ·¾³±äÁ¿ÉèÖã© ......
¡¡1¡¢FACTORY—×·MMÉÙ²»ÁËÇë³Ô·¹ÁË£¬Âóµ±À͵ļ¦³áºÍ¿ÏµÂ»ùµÄ¼¦³á¶¼ÊÇMM°®³ÔµÄ¶«Î÷£¬ËäÈ»¿ÚζÓÐËù²»Í¬£¬µ«²»¹ÜÄã´øMMÈ¥Âóµ±ÀÍ»ò¿ÏµÂ»ù£¬Ö»¹ÜÏò·þÎñԱ˵“À´Ëĸö¼¦³á”¾ÍÐÐÁË¡£Âóµ±ÀͺͿϵ»ù¾ÍÊÇÉú²ú¼¦³áµÄFactory
¡¡¡¡¹¤³§Ä£Ê½£º¿Í»§ÀàºÍ¹¤³§Àà·Ö¿ª¡£Ïû·ÑÕßÈκÎʱºòÐèҪijÖÖ²úÆ·£¬Ö»ÐèÏò¹¤³§ÇëÇó¼´¿É¡£Ïû· ......