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

Serializable javaÐòÁл¯

Bean Serializable Interface µÄ½Ó¿ÚÈÃBEAN¿ÉÒÔ´®Ðл¯£¬½«Æä±ä³ÉÒ»¸ö¿É±£´æΪÒÔºóʹÓõĶþ½øÖÆÁ÷¡£µ±Ò»¸öBEAN±»ÏµÁл¯µ½´ÅÅÌÉÏ»òÕßÆäËûÈκεط½£¬Æä״̬±»±£´æÆðÀ´£¬ÆäÖеÄÊôÐÔÖµÒ²²»»á¸Ä±ä¡£ÔÚBEANµÄ¹æ·¶ÖУ¬JSP²¢Ã»ÓÐÒªÇóBEANʵÏÖSerializable½Ó¿Ú¡£µ«ÊÇ£¬Èç¹ûÄúÏ£Íû×Ô¼º¿ØÖÆÄúËù´´½¨µÄ×é¼þµÄserialization½ø³Ì£¬»òÕßÄúÏëserialize²¢²»ÊDZê×¼×é¼þÀ©Õ¹µÄ×é¼þ£¬Äú±ØÐëÁ˽âserialization and deserializationµÄϸ½Ú¡£
¡¡¡¡Óм¸¸öÔ­ÒòÄã»á°ÑBEANÀä²ØÆðÀ´ÒÔ±¸ºóÓá£ÓÐЩ·þÎñÆ÷ͨ¹ý½«ËùÓеÄSESSION Êý¾Ý£¨°üÀ¨BEAN£©Ð´Èë´ÅÅÌÀ´Ö§³ÖÈÎÒⳤµÄSESSIONÉúÃüÆÚ£¬¼´Ê¹·þÎñÆ÷Í£»úÒ²²»»á¶ªÊ§¡£µ±·þÎñÆ÷ÖØÐÂÆô¶¯ºó£¬´®Ðл¯µÄÊý¾Ý±»»Ö¸´¡£Í¬ÑùµÄÀíÓÉ£¬ÔÚÖظºÔصÄÕ¾µãÉÏÖ§³Ö·þÎñÆ÷·Ö´ØµÄ»·¾³ÖУ¬Ðí¶à·þÎñÆ÷ͨ¹ý´®Ðл¯À´¸´ÖÆSESSION¡£Èç¹ûÄãµÄBEAN²»Ö§³Ö´®Ðл¯£¬·þÎñÆ÷¾Í²»ÄÜÕýÈ·µØ±£´æºÍ´«ÊäÀà¡£
¡¡¡¡Í¨¹ýͬÑùµÄ²ßÂÔ£¬Äã¿ÉÒÔÑ¡Ôñ½«BEAN±£´æÔÚ´ÅÅÌÉÏ»òÕßÊý¾Ý¿âÖУ¬ÒÔ±¸ºóÓá£ÀýÈ磬ҲÐí¿ÉÒÔ½«¿Í»§µÄ¹ºÎﳵʵÏÖΪһ¸öBEAN£¬ÔÚ·ÃÎÊÆڼ佫Æä±£´æÔÚÊý¾Ý¿âÖС£
¡¡¡¡Èç¹ûBEANÐèÒªÌØÊâµÄ¸´ÔӵijõʼÉèÖ㬿ÉÒÔ½«BEANÉèÖúúó´®Ðл¯±£´æÔÚ´ÅÅÌÉÏ¡£Õâ¸öBEANµÄ“¿ìÕÕ”¿ÉÒÔÓÃÔÚÈκÎÐèÒªµÄµØ·½£¬°üÀ¨ÔÚ$#@60;jsp:useBean$#@62;ÖÐÓÃbeanNameÊôÐԵĵ÷Óá£
¡¡¡¡$#@60;jsp:useBean$#@62;±êÇ©ÖеÄbeanNameÊôÐÔ£¬ÓÃÀ´ÊµÀý»¯Ò»¸ö´®Ðл¯µÄBEAN£¬¶ø²»ÊÇÓÃÀ´´ÓÒ»¸öÀà´´½¨Ò»¸öȫеÄʵÀý¡£Èç¹ûBEAN»¹Ã»Óд´½¨£¬beanNameÊôÐÔ´«¸øjava.beans.Bean.instantiate()·½·¨£¬ÓÉÀà×°ÔØÆ÷¶ÔÀà½øÐÐʵÀý»¯¡£ËüÊ×Ïȼٶ¨´æÔÚÒ»¸ö´®Ðл¯µÄBEAN£¨´øÓÐÀ©Õ¹Ãû.ser£©£¬È»ºó»á½«Æ伤»î¡£Èç¹ûÕâ¸ö²Ù×÷ʧ°Ü£¬Ëü¾Í»áʵÀý»¯Ò»¸öеÄʵÀý¡£
¡¡¡¡ÏÂÃæ¼òµ¥½éÉÜÒ»ÏÂÕâ¸ö½Ó¿Ú£º
¡¡¡¡¶ÔÏóÄÜ°üº¬ÆäËüµÄ¶ÔÏ󣬶øÕâÆäËüµÄ¶ÔÏóÓÖ¿ÉÒÔ°üº¬ÁíÍâµÄ¶ÔÏó¡£JAVA serializationÄܹ»×Ô¶¯µÄ´¦ÀíǶÌ׵ĶÔÏ󡣶ÔÓÚÒ»¸ö¶ÔÏóµÄ¼òµ¥µÄÓò£¬writeObject()Ö±½Ó½«ÖµÐ´ÈëÁ÷¡£¶ø£¬µ±Óöµ½Ò»¸ö¶ÔÏóÓòʱ£¬writeObject()±»Ôٴε÷Óã¬Èç¹ûÕâ¸ö¶ÔÏóÄÚǶÁíÒ»¸ö¶ÔÏó£¬ÄÇô£¬writeObject() ÓÖ±»µ÷Óã¬Ö±µ½¶ÔÏóÄܱ»Ö±½ÓдÈëÁ÷Ϊֹ¡£³ÌÐòÔ±ËùÐèÒª×öµÄÊǽ«¶ÔÏó´«ÈëObjectOutputStream µÄwriteObject() ·½·¨£¬Ê£ÏµĽ«ÓÖϵͳ×Ô¶¯Íê³É¡£ÏÂÃæµÄÀý×Ó´´½¨ÁËÒ»¸öµ÷ÓÃmine¶ÔÏóµÄPersonalData¶ÔÏó¡£´úÂëʵÏÖµÄÊǽ«Ò»¸ö´®ºÍmine ¶ÔÏóÊä³öµ½Ò»¸öÁ÷£¬²¢´æÈëÒ»¸öÎļþ£º
public class PersonalData implements Serializable {
public int id
public int yearOf


Ïà¹ØÎĵµ£º

¡¶javaÓïÑÔ³ÌÐòÉè¼Æ£¨Ò»£©¡·2009Äê×Ôѧ¿¼ÊÔ´ó¸ÙµÚ9ÕÂ

µÚ9Õ ÊäÈëºÍÊä³öÁ÷
(Ò»)¿Î³ÌÄÚÈÝ
9.1×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷
9.1.1 File¶ÔÏó
9.1.2Á÷¶ÔÏó
9.2»º³åʽÊäÈëÊä³ö
9.2.1»º³åʽÊäÈë
9.2.2»º³åʽÊä³ö
9.3Ëæ»ú·ÃÎÊ
9.4Îļþ¶Ô»°¿ò
(¶þ)ѧϰĿµÄÓëÒªÇó
±¾Õ½éÉÜJava³ÌÐòÊý¾ÝÎļþµÄÊäÈëÊä³ö¼¼Êõ¡£ÒªÇóÄܱàд¼òµ¥µÄJavaÎļþ´¦Àí³ÌÐò¡£
(Èý)¿¼ºË֪ʶµãÓ뿼ºËÒªÇó
1.´´½¨File¶ÔÏó£ ......

ÓйØjavaÖÐresultSetµÄÎÊÌâ

//´òÓ¡³ömess±íµÄÁÐÊýÊǶàÉÙ
public static void main(String[] args){
  String sql="select count(*) from mess";
  ResultSet set=null;
  try {
   Object paramValues[] = new Object[0];
         set = DBUtil.preExec ......

javaʱÇø½â¾ö·½°¸

 tomcatÆô¶¯web·þÎñµÄʱºò×ÜÊÇ»áÓÐ8СʱµÄʱ²î,
×ÁÄ¥Á˺þÃ,×î¼òµ¥µÄ°ì·¨¾ÍÊÇ
ÕÒµ½Îļþ¼Ðjdk1.6.0_07\jre\lib\zi\Etc
ÕâÀï±ß¶¼ÊÇһЩʱÇøÎļþGTM+1,GTM+2,GTM+3....
±¸·ÝÒ»·ÝEtc
¿½±´N·ÝGTM+8Îļþ(ÖйúµÄʱÇøÊÇGTM+8)
°ÑGMT+8ÎļþÃû¸Ä³ÉGTM+1,GTM+2,GTM+3....
¸²¸ÇµôÔ­À´µÄEtcÀï±ßµÄÎļþ
ÖØÆôtomcatÎÊÌâ½â¾ö ......

JAVA»·¾³±äÁ¿ÉèÖÃ

¾ÙÀý×Ó˵Ã÷Ò»ÇС£
JAVA_HOME£º C:\j2sdk1.4.2_13
 
Path£º         C:\j2sdk1.4.2_13\bin;
Classpath£º.;JAVA_HOME\lib\tools.jar ; JAVA_HOME\lib\dt.jar;
                 &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ