¶¯Ì¬Ö´ÐÐJava½Å±¾
1 ±³¾°
ÔÚÎÒÃǵÄÏîÄ¿ÖУ¬ÓÐʱºòÔÚÐèÒªÔËÐÐʱ»ñÈ¡Ò»¶Î½Å±¾²¢Ö´ÐÐÆäÂß¼ÒÔÁé»îµØʵÏÖÒµÎñÐèÇó¡£ÓÐÈ˵ĵÚÒ»Ïë·¨¾ÍÊǽű¾ÓïÑÔ£¬ÎÒÃǵ±È»¿ÉÒÔÔÚ³ÌÐòÖÐÄÚǶһ¸öPython½âÊÍÆ÷£¬È»ºóÔÚÐèÒªÁé»î±ä¶¯µÄµØ·½Ê¹ÓÃPython½Å±¾ÊµÏÖÎÒÃǵÄÂß¼¡£µ«ÊÇÕâÑù×öÌ«“ÖØÁ¿¼¶”ÁË£¬¿öÇÒÉíΪһ¸öJava³ÌÐòÔ±£¬Äã²»Ò»¶¨¶®µÃPythonµÄÓï·¨£¬ÓÖ»òÕßÄãÖÒÓÚJava¸ù±¾²»Ô¸°ÑÏîÄ¿½»ÍиøÆäËûÓïÑÔ¡£Èç¹ûÄܹ»Ê¹Ó÷ûºÏJavaÓï·¨µÄ½Å±¾£¬¶øÇÒ²»±ØǶÈëÈκνâÊÍÆ÷£¬ÄÇôÕâÊDz»ÊÇÒ»¸öÍêÃÀµÄÑ¡Ôñ£¿
2 ÔÀí
Java±¾Éí¾ßÓÐ×ã¹»µÄÁé»îÐÔÄÜÈÃÎÒÃÇ×öµ½ÕâÒ»µã£¬JVM¿ÉÒÔÔÚÔËÐÐʱ¶¯Ì¬±àÒëJavaÔ´ÎļþÈ»ºó¼ÓÔØÀ࣬ÕâÊÇJava½Å±¾¶¯Ì¬»ñµÃÉúÃüÁ¦µÄ»ù´¡¡£²»¹ý£¬¶¯Ì¬±àÒëµÄÊäÈëÊÇÒ»¸öÍêÕûµÄJavaÀàµÄÔ´Îļþ£¬ºÍjavac¹¤¾ßÒ»Ñù£¬¶øÎÒÃÇÒªÖ´ÐеĽö½öÊÇÒ»¶Î½Å±¾¡£ÁíÍ⣬Õâ¶ÎJava½Å±¾»¹ÐèÒªÓÐÉÏÏÂÎÄ»·¾³£¬ÀýÈçÊäÈëºÍÊä³ö£¬²»È»Æ¾¿Õдһ¶Î½Å±¾Ã»ÓÐÈκÎÒâÒ壬Õâ¾ÍÒª·ÑÒ»·¬ÐÄ˼ȥÉè¼ÆÁË¡£ÒªÂú×ãÕâЩҪÇóÒ²²»ÄÑ£¬ÕâÀïÌṩһ¸ö¼òµ¥µÄʵÏÖ·½·¨£¬»ù±¾Ë¼Â·ÊÇÉú³ÉÒ»¸öÁÙʱÀ࣬½«ÉÏÏÂÎıäÁ¿ÉùÃ÷Ϊ¸ÃÀàµÄ³ÉÔ±£¬½«½Å±¾·ÅÔÚ¸ÃÀàµÄexcute()·½·¨ÀȻºó½«Õâ¸öÁÙʱÀද̬±àÒë²¢Ö´ÐÐexcute()·½·¨£¬¼´¿Éʹ½Å±¾ÉúЧ¡£¶ÔÓÚ³ÌÐòÀ´Ëµ£¬¶¯Ì¬±àÒëµÄ¹ý³ÌÊÇ͸Ã÷µÄ£¬Æä½á¹ûÊÇ׼ȷ»ñµÃÁ˽ű¾µÄÊä³ö¡£
3 ¾ßÌåʾÀý
3.1 ÐèÇóÃèÊö
³ÌÐò´ÓÊý¾Ý¿âÖÐÈ¡³öÁ˱ðÃûºÍÐÕÃû£¬¶øÔÚ½çÃæÉÏÏÔʾÔõÑùµÄÃû×ÖÈ´²»È·¶¨£¬ÒòΪÕâµã»á¾³£±ä¶¯£¬ÓÐЩ³¡ºÏÏÔʾ±ðÃûºÍÐÕÃûµÄ×éºÏ£¬ÓÐЩ³¡ºÏ½öÏÔʾÐÕÃûµÈµÈ£¬ÎªÁËÊÊÓ¦ÕâÖÖÁé»î±ä»¯£¬ÐèÒª½«ÈçºÎÏÔʾÃû³ÆµÄÂß¼×÷Ϊһ¶Î½Å±¾Ð´ÔÚÍⲿÎļþÀ³ÌÐòÔÚÔËÐÐʱִÐÐÕâ¶Î½Å±¾µÃµ½Ãû³ÆÈ»ºóÏÔʾ¡£
3.2 ½â¾ö¹ý³Ì
¼ÙÉè³ÌÐò´ÓÊý¾Ý¿âÖÐÈ¡³öÁ˱ðÃûºÍÐÕÃû£¬·Ö±ð´æÈë±äÁ¿
String alias = “ÍòÀï¶ÀÐД;
String name = “Ìï²®¹â”;
²¢´ÓÍⲿÎļþ¶ÁÈ¡Á˽ű¾ÄÚÈÝ
String script = “displayName = aliasName + ':' + originalName”;
´Ó½Å±¾Àï¿ÉÒÔ¿´µ½3¸ö±äÁ¿£¬·Ö±ðÊÇdisplayName¡¢aliasNameºÍoriginalName£¬ÕâÊÇÎÒÃÇĬÈÏÌṩ¸ø½Å±¾µÄÉÏÏÂÎıäÁ¿»·¾³£¬¾ÍÏñÔÚJspÒ³ÃæÀïĬÈÏÓÐrequest¶ÔÏóÒ»Ñù¡£
3.2.1 Ê×ÏÈÐèÒª¹¹ÔìÒ»¸öJavaÀàµÄÍêÕûÔ´´úÂë
ÀûÓÃStringBuilder¹¹ÔìÈçÏÂÄÚÈݵÄ×Ö·û´® String javaSource£º
public class Temp
{
public String aliasName;
public String originalName;
public String displayName;
public void excute()
{
displayName = aliasNam
Ïà¹ØÎĵµ£º
1 ÈÕÖ¾¼¶±ð
oFATAL
¼Ç¼ӰÏìϵͳÕý³£ÔËÐУ¬¿ÉÄܵ¼ÖÂϵͳ±ÀÀ£µÄʼþ
oERROR
¼Ç¼ӰÏìÒµÎñÁ÷³ÌÕý³£½øÐУ¬µ¼ÖÂÒµÎñÁ÷³ÌÌáÇ°ÖÕÖ¹µÄʼþ
oWARN
¼Ç¼δԤÁϵ½£¬¿ÉÄܵ¼ÖÂÒµÎñÁ÷³ÌÎÞ·¨½øÐеÄʼþ
oINFO
¼Ç¼ϵͳÆô¶¯/Í£Ö¹£¬Ä£¿é¼ÓÔØ/жÔØÖ®Ààʼþ
oDEBUG
¼Ç¼ҵÎñÏêϸÁ÷³Ì£¬Óû§¼øȨ/ÒµÎñÁ÷³ÌÑ¡Ôñ/Êý¾Ý´æȡʼþ
oTRACE
......
¸ñʽ»¯Êä³öÊý×Ö
·Ò룺Cherami
email:cherami@163.net
ÔÎÄ£ºhttp://developer.java.sun.com/developer/TechTips/2000/tt0411.html
ÓÐʱÎÒÃÇÐèÒª¿ØÖÆÊä³öµÄÊý×ֵĸñʽ£¬ÈçºÎʹÓÃjavaµÄÀà¿â×öµ½Õâ¸öÄØ£¿
Ò²ÐíÄã²»¹ØÐĸñʽ£¬µ«ÊÇÄãÐèÒª¹ØÐÄÄãµÄ³ÌÐò¿ÉÒÔÔÚÈ«ÊÀ½çͨÓã¬Ï ......
Ò»¹²ÓÐÈý¸öÀࣺWriteFile ; ReadFile ; InsertDB ;
//WriteFile.java
//ÓÃÓÚ½«ÐÅϢдÈëÎı¾Îļþ
package org.mb.insertfromfile;
import java.io.*;
public class WriteFile{
private int count = 0 ;
public int getCount() {
return count;
}
public void setCount(int count) {
this.cou ......
Java³ÌÐò¿ª·¢ÈËÔ±ÐèÒªÁ˽â¸÷¸ö´æ´¢ÇøÓòµÄÌصãÒÔ¼°¶ÔÐÔÄܵÄÓ°Ï졣ȻºóÔÙ¸ù¾ÝÐèÒªÀ´µ÷ÕûÓ¦ÓóÌÐòµÄÇøÓò·ÖÅä¡£×ܵÄÀ´Ëµ£¬ÔÚ²Ù×÷ϵͳÖÐÓÐÎå¸öµØ·½¿ÉÒÔÓÃÀ´±£´æÓ¦ÓóÌÐòÔËÐÐÖеÄÊý¾Ý¡£ÕâÀàÇøÓòµÄÌصãÒÔ¼°¶ÔÐÔÄܵÄÓ°Ïì·ÖÎöÈçÏ¡£
´æ´¢ÇøÓòÒ»£º¼Ä´æÆ÷
ËäȻͬÔÚÄÚ´æÖУ¬µ«ÊDz»Í¬µÄÇøÓòÓÉÓÚÓÃ;²»Í ......
Java Êý¾ÝÁ÷2(PipedInputStream,PipedOutputStream...)
2007-08-18 17:30
×Ö½ÚÁ÷µÄ¸ß¼¶Ó¦ÓÃ
? ¹ÜµÀÁ÷
¹ÜµÀÓÃÀ´°ÑÒ»¸ö³ÌÐò¡¢Ï̺߳ʹúÂë¿éµÄÊä³öÁ¬½Óµ½ÁíÒ»¸ö³ÌÐò¡¢Ï̺߳ʹúÂë¿éµÄÊäÈë¡£java.ioÖÐÌṩÁËÀàPipedInputStreamºÍPipedOutputStream×÷Ϊ¹ÜµÀµÄÊäÈë/Êä³öÁ÷
¹ÜµÀÊäÈëÁ÷×÷ ......