Java 6 RowSet ʹÓÃÍêÈ«ÆÊÎö(1)
Java 6 RowSet ʹÓÃÍêÈ«ÆÊÎö(1)
¹Ø¼ü×Ö: rowset
javax.sql.rowset ×Ô JDK 1.4 ÒýÈ룬´Ó JDK 5.0 ¿ªÊ¼ÌṩÁ˲ο¼ÊµÏÖ¡£ËüÖ÷Òª°üÀ¨ CachedRowSet£¬WebRowSet£¬FilteredRowSet£¬JoinRowSet ºÍ JdbcRowSet¡£ ³ýÁË JdbcRowSet ÒÀÈ»±£³Ö×ÅÓëÊý¾ÝÔ´µÄÁ¬½ÓÖ®Í⣬ÆäÓàËĸö¶¼ÊÇ Disconnected RowSet¡£
Ïà±È½Ï java.sql.ResultSet ¶øÑÔ£¬RowSet µÄÀëÏß²Ù×÷Äܹ»ÓÐЧµÄÀûÓüÆËã»úÔ½À´Ô½³ä×ãµÄÄڴ棬¼õÇáÊý¾Ý¿â·þÎñÆ÷µÄ¸ºµ££¬ÓÉÓÚÊý¾Ý²Ù×÷¶¼ÊÇÔÚÄÚ´æÖнøÐÐÈ»ºóÅúÁ¿Ìá½»µ½Êý¾ÝÔ´£¬Áé»îÐÔºÍÐÔÄܶ¼ÓÐÁ˺ܴóµÄÌá¸ß¡£RowSet ĬÈÏÊÇÒ»¸ö¿É¹ö¶¯£¬¿É¸üУ¬¿ÉÐòÁл¯µÄ½á¹û¼¯£¬¶øÇÒËü×÷Ϊ JavaBeans£¬¿ÉÒÔ·½±ãµØÔÚÍøÂç¼ä´«Ê䣬ÓÃÓÚÁ½¶ËµÄÊý¾Ýͬ²½¡£
Àà¼Ì³Ð½á¹¹
RowSet ¼Ì³Ð×Ô ResultSet£¬ÆäËûÎå¸ö RowSet ½Ó¿Ú¾ù¼Ì³Ð×Ô RowSet¡£ÏÂͼÊÇËüÃǵļ̳йØÏµ¡£
ͼ 1. ¼Ì³Ð½á¹¹Í¼
ʵÑé»·¾³
±¾ÎÄʾÀýµÄʵÑé»·¾³ÈçÏ£º
Java »·¾³£ºSun JDK 6.0
Êý¾Ý¿â£ºderby-10.3.1.4
Êý¾Ý¿âÃû£ºTESTDB
Êý¾Ý¿âÓû§Ãû¼°ÃÜÂ룺¾ùʹÓà derby ĬÈÏÓû§ÃûºÍÃÜÂë¡£
±í¼°²âÊÔÊý¾Ý£º´´½¨Á½¸ö±í£ºCUSTOMERS ºÍ ORDERS£¬²¢·Ö±ð²åÈë²âÊÔÊý¾Ý¡£
ʾÀý´úÂëÒÔ¸½¼þÐÎʽÌṩ ÏÂÔØ¡£
±í 2. ±í CUSTOMERS ID NAME REMARK
1 Tom Tom is VIP
2 Jim null
±í 3. ±í ORDERS ID USER_ID PRODUCT
1 1 Book
2 1 Computer
3 2 Phone
ʹÓà CachedRowSet
Ìî³ä CachedRowSet µÄÁ½ÖÖ·½Ê½
CachedRowSet ÌṩÁËÁ½¸öÓÃÀ´»ñÈ¡Êý¾ÝµÄ·½·¨£¬Ò»¸öÊÇ execute()£¬ÁíÒ»¸öÊÇ populate(ResultSet)¡£
ʹÓà execute() Ìî³ä CachedRowSet ʱ£¬ÐèÒªÉèÖÃÊý¾Ý¿âÁ¬½Ó²ÎÊýºÍ²éѯÃüÁî command£¬ÈçÏÂʾÀý´úÂ룺
Çåµ¥ 1. ʹÓà execute()
Java´úÂë
cachedRS.setUrl(DBCreator.DERBY_URL);
cachedRS.setCommand(DBCreator.SQL_SELECT_CUSTOMERS); // derby ĬÈÏÓû§ÃûºÍÃÜÂë¶¼ÊÇ "APP"£¬Ò²¿ÉÒÔ²»ÉèÖᣠcachedRS.setUsername("APP"); //$NON-NLS-1$
cachedRS.setPassword("APP"); //$NON-NLS-1$
cachedRS.execute();
cachedRS.setUrl(DBCreator.DERBY_URL);
cachedRS.setCommand(DBCreator.SQL_SELECT_CUSTOMERS); // derby ĬÈÏÓû§ÃûºÍÃÜÂë¶¼ÊÇ "APP"£¬Ò²¿ÉÒÔ²»ÉèÖᣠcachedRS.setUsername("APP"); //$NON-NLS-1$
cachedRS.setPassword("APP"); //$NON-NLS-1$
cachedRS.execute()
Ïà¹ØÎĵµ£º
JavaÓïÑÔ»ù´¡
̸µ½JavaÓïÑÔ»ù´¡Ñ§Ï°µÄÊé¼®£¬´ó¼Ò¿Ï¶¨»áÍÆ¼öBruce EckelµÄ¡¶ThinkinginJava¡·¡£ËüÊÇÒ»±¾Ð´µÄÏ൱Éî¿ÌµÄ¼¼ÊõÊé¼®£¬JavaÓïÑÔ»ù´¡²¿·Ö»ù±¾Ã»ÓÐÆäËüÈκÎÒ»±¾Êé¿ÉÒÔ³¬Ô½Ëü¡£¸ÃÊéµÄ×÷ÕßBruceEckelÔÚÍøÂçÉϱ»³ÆÎªÌì²ÅµÄͶ»úÕߣ¬×÷Õߵġ¶Thinking in C++¡·ÔÚ1995ÄêÔø»ñSoftwareDevelopmentJoltAward×î¼ÑÊé¼®´ó½±£¬¡ ......
ÔÌùµØÖ·http://www.javaeye.com/topic/257191
½ñÌìÏÂÎçÑо¿Á˰ëÌìhashcode()ºÍequals()·½·¨£¬ÖÕÓÚÓÐÁËÒ»µãµãµÄÃ÷°×£¬Ð´ÏÂÀ´Óë´ó¼Ò·ÖÏí£¨zhaoxudong
2008.10.23Íí21.36£©¡£
1. Ê×ÏÈequals()ºÍhashcode()ÕâÁ½¸ö·½·¨¶¼ÊÇ´ÓobjectÀàÖм̳йýÀ´µÄ¡£
equals()·½·¨ÔÚobjectÀàÖж¨ÒåÈçÏ£º
public boolean equals( ......
http://public0821.javaeye.com/blog/423941
C++µ÷ÓÃJAVAÖ÷ÒªÓõ½ÁËSUN¹«Ë¾µÄJNI¼¼Êõ£¬ JNIÊÇJava Native InterfaceµÄ Ëõд¡£´ÓJava 1.1¿ªÊ¼£¬Java Native Interface (JNI)±ê×¼³ÉΪjavaƽ̨µÄÒ»²¿·Ö£¬ËüÔÊÐíJava´úÂëºÍÆäËûÓïÑÔдµÄ´úÂë½øÐн»»¥¡£Ïà¹Ø×ÊÁϼûhttp://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.htm ......
Java socket×ܽá
Ò»£¬ÍøÂç±à³ÌÖÐÁ½¸öÖ÷ÒªµÄÎÊÌâ
Ò»¸öÊÇÈçºÎ׼ȷµÄ¶¨Î»ÍøÂçÉÏһ̨»ò¶ą̀Ö÷»ú£¬ÁíÒ»¸ö¾ÍÊÇÕÒµ½Ö÷»úºóÈçºÎ¿É¿¿¸ßЧµÄ½øÐÐÊý¾Ý´«Êä¡£
ÔÚ
TCP/IPÐÒéÖÐ
IP²ãÖ÷Òª¸ºÔðÍøÂçÖ÷»úµÄ¶¨Î»£¬Êý¾Ý´«ÊäµÄ·ÓÉ£¬ÓÉ
IPµØÖ·¿ÉÒÔΨһµØÈ·¶¨
InternetÉϵÄһ̨Ö÷»ú¡£
¶ø
TCP²ãÔòÌá¹©ÃæÏòÓ¦ÓõĿɿ¿£¨
tcp£©µÄ»ò·Ç¿É¿ ......