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()
Ïà¹ØÎĵµ£º
²ÎÊý˵Ã÷
fileName£º ±íʾÏë½âѹµÄÎļþÃû È磺c:\\aaa\a.zip
unZipDir£º ±íʾÏë½âѹµ½µÄ·¾¶ È磺c:\\ccc
public static void unZip1(String fileName, String unZipDir) {
try {
Fil ......
´ò¿ªÖնˣ¬Ö´ÐÐÒÔÏÂÃüÁ»òʹÓÃAdept/ÐÂÁ¢µÃÈí¼þ¹ÜÀíÆ÷£¬ÔÚÆäÖзֱðËÑË÷"sun-java6-jre"ºÍ"sun-java6-jdk"²¢±ê¼Ç°²×°¡£
sudo apt-get install sun-java6-jre
Èç¹û¿Õ¼ä¸»Ô££¬½¨Òé°²×°Ò»¸öJDK¡£
sudo apt-get install sun-java6-jdk
Ìáʾ£º°²×°¹ý³ÌÖÐÐèÒªÄã»Ø´ðÊÇ·ñͬÒâʹÓÃÐÒ飨ÖÕ¶ËÖкìÀ¶É«µÄÌ ......
ÔÌùµØÖ·http://www.javaeye.com/topic/257191
½ñÌìÏÂÎçÑо¿ÁË°ëÌìhashcode()ºÍequals()·½·¨£¬ÖÕÓÚÓÐÁËÒ»µãµãµÄÃ÷°×£¬Ð´ÏÂÀ´Óë´ó¼Ò·ÖÏí£¨zhaoxudong
2008.10.23Íí21.36£©¡£
1. Ê×ÏÈequals()ºÍhashcode()ÕâÁ½¸ö·½·¨¶¼ÊÇ´ÓobjectÀàÖм̳йýÀ´µÄ¡£
equals()·½·¨ÔÚobjectÀàÖж¨ÒåÈçÏ£º
public boolean equals( ......
×î½üÎÒÓöµ½ºÜ¶àjava¿ª·¢µÄÐÂÈË£¬°üÀ¨ºÜ×ÔÈÏΪ²»ÊÇÐÂÈ˵ÄÈ˸ù±¾¾Í²»»á×Ô¼º´î½¨Ò»¸öÍêÕûµÄ¿ª·¢»·¾³£¬Òò´ËÏëд´ËÎÄ£¬Ï£¶ÔËûÃÇÓÐËù°ïÖú£¬½â³ýËûÃǵÄһЩ¿ª·¢À§»ó£¬¸üºÃµÄÁ˽âjava.
Ò»¡¢windowsÏ¿ª·¢»·¾³µÄ´î½¨
1¡¢´Óhttp://java.sun.com/ÉÏÏÂÔØwindowsƽ̨µÄJDK,²¢°²×°¡£¼ÙÉ谲װĿ¼Ϊ£ºC:\jdk6.0
2¡¢É趨Ïà¹Ø»·¾³Á¿£¨ÒÔwi ......
Java socket×ܽá
Ò»£¬ÍøÂç±à³ÌÖÐÁ½¸öÖ÷ÒªµÄÎÊÌâ
Ò»¸öÊÇÈçºÎ׼ȷµÄ¶¨Î»ÍøÂçÉÏһ̨»ò¶ą̀Ö÷»ú£¬ÁíÒ»¸ö¾ÍÊÇÕÒµ½Ö÷»úºóÈçºÎ¿É¿¿¸ßЧµÄ½øÐÐÊý¾Ý´«Êä¡£
ÔÚ
TCP/IPÐÒéÖÐ
IP²ãÖ÷Òª¸ºÔðÍøÂçÖ÷»úµÄ¶¨Î»£¬Êý¾Ý´«ÊäµÄ·ÓÉ£¬ÓÉ
IPµØÖ·¿ÉÒÔΨһµØÈ·¶¨
InternetÉϵÄһ̨Ö÷»ú¡£
¶ø
TCP²ãÔòÌṩÃæÏòÓ¦ÓõĿɿ¿£¨
tcp£©µÄ»ò·Ç¿É¿ ......