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

Êý¾Ý¿âResultSetÏê½â£¨java£©

ÕâƪÎÄÕ²¢Ã»Óиø³öÈçºÎʹÓÃResultSetµÄ¾ßÌåÀý×Ó£¬Ö»ÊÇ´ÓResultSetµÄ¹¦ÄÜÐÔÉϽøÐÐÁËÏêϸµÄ½²Êö¡£Ï£ÍûÕâƪÎÄÕ¶Դó¼ÒÀí½âResultSetÄܹ»ÓÐËù°ïÖú¡£ÏÂÃæ¾ÍÊÇÕâƪÎÄÕµľßÌåÄÚÈÝ¡£
         ½á¹û¼¯(ResultSet)ÊÇÊý¾ÝÖвéѯ½á¹û·µ»ØµÄÒ»ÖÖ¶ÔÏ󣬿ÉÒÔ˵½á¹û¼¯ÊÇÒ»¸ö´æ´¢²éѯ½á¹ûµÄ¶ÔÏ󣬵«Êǽá¹û¼¯²¢²»½ö½ö¾ßÓд洢µÄ¹¦ÄÜ£¬Ëûͬʱ»¹¾ßÓвÙ×ÝÊý¾ÝµÄ¹¦ÄÜ£¬¿ÉÄÜÍê³É¶ÔÊý¾ÝµÄ¸üеȡ£
        ½á¹û¼¯¶ÁÈ¡Êý¾ÝµÄ·½·¨Ö÷ÒªÊÇgetXXX()£¬ËûµÄ²ÎÊý¿ÉÒÔʹÕûÐͱíʾµÚ¼¸ÁУ¨ÊÇ´Ó1¿ªÊ¼µÄ£©£¬»¹¿ÉÒÔÊÇÁÐÃû¡£·µ»ØµÄÊǶÔÓ¦µÄXXXÀàÐ͵ÄÖµ¡£Èç¹û¶ÔÓ¦ÄÇÁÐʱ¿ÕÖµ£¬XXXÊǶÔÏóµÄ»°·µ»ØXXXÐ͵ĿÕÖµ£¬Èç¹ûXXXÊÇÊý×ÖÀàÐÍ£¬ÈçFloatµÈÔò·µ»Ø0£¬boolean·µ»Øfalse¡£Ê¹ÓÃgetString()¿ÉÒÔ·µ»ØËùÓеÄÁеÄÖµ£¬²»¹ý·µ»ØµÄ¶¼ÊÇ×Ö·û´®ÀàÐ͵ġ£XXX¿ÉÒÔ´ú±íµÄÀàÐÍÓУº»ù±¾µÄÊý¾ÝÀàÐÍÈçÕûÐÍ(int)£¬²¼¶ûÐÍ(Boolean)£¬¸¡µãÐÍ(Float,Double)µÈ£¬±ÈÌØÐÍ£¨byte£©£¬»¹°üÀ¨Ò»Ð©ÌØÊâµÄÀàÐÍ£¬È磺ÈÕÆÚÀàÐÍ£¨java.sql.Date£©£¬Ê±¼äÀàÐÍ(java.sql.Time)£¬Ê±¼ä´ÁÀàÐÍ(java.sql.Timestamp)£¬´óÊýÐÍ(BigDecimalºÍBigIntegerµÈ)µÈ¡£»¹¿ÉÒÔʹÓÃgetArray(int colindex/String columnname)£¬Í¨¹ýÕâ¸ö·½·¨»ñµÃµ±Ç°ÐÐÖУ¬colindexËùÔÚÁеÄÔªËØ×é³ÉµÄ¶ÔÏóµÄÊý×顣ʹÓÃgetAsciiStream(
int colindex/String colname)¿ÉÒÔ»ñµÃ¸ÃÁжÔÓ¦µÄµ±Ç°ÐеÄasciiÁ÷¡£Ò²¾ÍÊÇ˵ËùÓеÄgetXXX·½·¨¶¼ÊǶԵ±Ç°ÐнøÐвÙ×÷¡£
    ½á¹û¼¯´ÓÆäʹÓõÄÌصãÉÏ¿ÉÒÔ·ÖΪËÄÀ࣬ÕâËÄÀàµÄ½á¹û¼¯µÄËù¾ß±¸µÄÌص㶼ÊǺÍStatementÓï¾äµÄ´´½¨Óйأ¬ÒòΪ½á¹û¼¯ÊÇͨ¹ýStatementÓï¾äÖ´Ðкó²úÉúµÄ£¬ËùÒÔ¿ÉÒÔ˵£¬½á¹û¼¯¾ß±¸ºÎÖÖÌص㣬ÍêÈ«¾ö¶¨ÓÚStatement£¬µ±È»ÎÒÊÇ˵ÏÂÃæÒª½«µÄËĸöÌص㣬ÔÚStatement´´½¨Ê±°üÀ¨ÈýÖÖÀàÐÍ¡£Ê×ÏÈÊÇÎÞ²ÎÊýÀàÐ͵ģ¬Ëû¶ÔÓ¦µÄ¾ÍÊÇÏÂÃæÒª½éÉܵĻù±¾µÄResultSet¶ÔÓ¦µÄStatement¡£ÏÂÃæµÄ´úÂëÖÐÓõ½µÄConnection²¢Ã»ÓжÔÆä³õʼ»¯£¬±äÁ¿conn´ú±íµÄ¾ÍÊÇConnection¶ÔÓ¦µÄ¶ÔÏó¡£SqlStr´ú±íµÄÊÇÏìÓ¦µÄSQLÓï¾ä¡£
1¡¢    ×î»ù±¾µÄResultSet¡£
Ö®ËùÒÔ˵ÊÇ×î»ù±¾µÄResultSetÊÇÒòΪ£¬Õâ¸öResultSetËûÆðµ½µÄ×÷ÓþÍÊÇÍê³ÉÁ˲éѯ½á¹ûµÄ´æ´¢¹¦ÄÜ£¬¶øÇÒÖ»ÄܶÁÈ¥Ò»´Î£¬²»Äܹ»À´»ØµÄ¹ö¶¯¶ÁÈ¡¡£ÕâÖÖ½á¹û¼¯µÄ´´½¨·½Ê½ÈçÏ£º
Statement st = conn.CreateStatement
ResultSet rs = Statement.excuteQuery(sqlStr);
ÓÉÓÚÕâÖÖ½á¹û¼¯²»Ö§³Ö£¬¹ö¶


Ïà¹ØÎĵµ£º

¡¾JavaÍøÂç±à³ÌÒ»¡¿Ò»¸ö¼òµ¥µÄc/s³ÌÐò

ʵÑéÒªÇó£º
1.±àд»ùÓÚTCPЭÒéµÄͨÐųÌÐò£¬°üÀ¨ServerÓëClientÁ½¸ö²¿·Ö¡£ÊµÏÖ»ØÉù³ÌÐò£º¼´¿Í»§¶Ë·¢ËÍÏûÏ¢£¬·þÎñÆ÷¶Ë½«ÊÕµ½µÄÏûÏ¢Ô­Ñù»áË͸ø¿Í»§¶Ë¡£
2.ÔÚµ¥»úÉÏÔËÐÐËüÃÇ£¬ÑéÖ¤ÆäͨÐŽá¹û£»
3.ÔÚ¶à»úÉÏÔËÐÐËüÃÇ£¬ÑéÖ¤ÆäͨÐŽá¹û£»£¨ChatServerÖ»ÐèÔËÐÐÔÚһ̨Ö÷»úÉÏ£¬ChatClient¿ÉÔÚÆäËüÖ÷»úÉÏÔËÐУ¨ÒªÖªµÀChatServerËùÔ ......

javaÁ¬½ÓmysqlÊý¾Ý¿â

Ê×ÏÈ£¬ÒªÏÂÔØÒ»¸öÁ¬½ÓmysqlÊý¾Ý¿âµÄÇý¶¯³ÌÐò: mysql-connector-java-3.0.15-ga-bin.jar, Õâ¸öÇý¶¯³ÌÐò²»ÐèÒª×öÆäËüÅäÖÃ,Ò²¾ÍÊÇ˵£¬¶ÔÓÚmysqlÊý¾Ý¿â£¬²»±ØÏñaccess»òÕßoracleÒª½¨Á¢odbcÊý¾ÝÔ´¡£
 
Æä´Î£¬½«ÉÏÃæµÄ.jarÎļþ¼ÓÈëµ½classpath»·¾³±äÁ¿ÖС£
×îºó£¬¾ÍÊÇд´úÂë½øÐвâÊÔÁË¡£
 
Ö÷Òª´úÂëÈçÏ£º
  ......

AndroidÖи÷ÖÖJAVA°üµÄ¹¦ÄÜÃèÊö

ÔÚAndroidµÄÓ¦ÓóÌÐò¿ª·¢ÖУ¬Í¨³£Ê¹ÓõÄÊÇJAVAÓïÑÔ£¬³ýÁËÐèÒªÊìϤJAVAÓïÑԵĻù´¡ÖªÊ¶Ö®Í⣬»¹ÐèÒªÁ˽âAndroidÌṩµÄÀ©Õ¹µÄJAVA¹¦ÄÜ¡£
ÔÚÒ»°ãµÄJAVAÓ¦ÓÃÖУ¬Èç¹ûÐèÓÃÒýÓûù´¡Àà¿â£¬Í¨³£ÐèҪʹÓÃÈçϵķ½Ê½£º
import
javax.swing.*;
ÒÔÉÏ´úÂë±íʾÁËÒýÓÃJAVAµÄGUI×é¼þSwing,javax.swing¼´JAVAÖеÄÒ»¸ö°ü¡£
androidÌṩһР......

JAVA WEB Ïà¹ØµÄ×Ö·û±àÂë


1. ¸ÅÊö
±¾ÎÄÖ÷Òª°üÀ¨ÒÔϼ¸¸ö·½Ã棺±àÂë»ù±¾ÖªÊ¶£¬java£¬ÏµÍ³Èí¼þ£¬url£¬¹¤¾ßÈí¼þµÈ¡£  
ÔÚÏÂÃæµÄÃèÊöÖУ¬½«ÒÔ"ÖÐÎÄ"Á½¸ö×ÖΪÀý£¬¾­²é±í¿ÉÒÔÖªµÀÆäGB2312±àÂëÊÇ"d6d0 cec4"£¬Unicode±àÂëΪ"4e2d 6587"£¬UTF±àÂë¾ÍÊÇ"e4b8ad e69687"¡£×¢Ò⣬ÕâÁ½¸ö×ÖûÓÐiso8859-1±àÂ룬µ«¿ÉÒÔÓÃiso8859-1±àÂëÀ´"±íʾ"¡£  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ