Êý¾Ý¿â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);
ÓÉÓÚÕâÖÖ½á¹û¼¯²»Ö§³Ö£¬¹ö¶
Ïà¹ØÎĵµ£º
WindowsÏÂJAVA»·¾³±äÁ¿µÄÉèÖÃ
WindowsÏÂJAVAÓõ½µÄ»·¾³±äÁ¿Ö÷ÒªÓÐ3¸ö£¬JAVA_HOME¡¢CLASSPATH¡¢PATH¡£ÏÂÃæÖð¸ö·ÖÎö¡£
JAVA_HOME Ö¸ÏòµÄÊÇJDKµÄ°²×°Â·¾¶£¬Èçx:\JDK_1.4.2£¬ÔÚÕâ·¾¶ÏÂÄãÓ¦¸ÃÄܹ»ÕÒµ½bin¡¢libµÈĿ¼¡£ÖµµÃÒ»ÌáµÄÊÇ£¬JDK µÄ°²×°Â·¾¶¿ÉÒÔÑ¡ÔñÈÎÒâ´ÅÅÌĿ¼£¬²»¹ý½¨ÒéÄã·ÅµÄĿ¼²ã´ ......
ÔÚAndroidµÄÓ¦ÓóÌÐò¿ª·¢ÖУ¬Í¨³£Ê¹ÓõÄÊÇJAVAÓïÑÔ£¬³ýÁËÐèÒªÊìϤJAVAÓïÑԵĻù´¡ÖªÊ¶Ö®Í⣬»¹ÐèÒªÁ˽âAndroidÌṩµÄÀ©Õ¹µÄJAVA¹¦ÄÜ¡£
ÔÚÒ»°ãµÄJAVAÓ¦ÓÃÖУ¬Èç¹ûÐèÓÃÒýÓûù´¡Àà¿â£¬Í¨³£ÐèҪʹÓÃÈçϵķ½Ê½£º
import
javax.swing.*;
ÒÔÉÏ´úÂë±íʾÁËÒýÓÃJAVAµÄGUI×é¼þSwing,javax.swing¼´JAVAÖеÄÒ»¸ö°ü¡£
androidÌṩһР......
Òª¿ªÊ¼Ñ§Ï°JavaÁË
ÉùÃ÷£ºÒÔÏÂÊÇÎÒתÔصģ¬ÎÒ¾õµÃͦ²»´íµÄ ÄÃÀ´·ÖÏí¡£
j2eeµÄѧϰ˳Ðò
ÎÒÈÏΪj2eeÒ»¶¨ÒªÑÐò½¥½ø£¬ÎÒ×Ô¼º¾ÍÊÇÕâÑù£¬´ÓÒ»¸öÒ»°ã¸ßУ¼ÆËã»úϵ±ÏÒµ£¬
È»ºóÂú»³ÃÎÏëºÍ¼¤ÇéÈ¥ÕÒ¹¤×÷£¬ÎÒkao,ÄǸöµ¥Î»¶¼¸øÎÒ°×ÑÛ£¬Á¬»áÀϼҵÄÐĶ¼ÓÐÁË£¬ÄǸöʱºòºÍ¼¸¸ö¸çÃÇ£¬×¡ÔÚµØÏÂÊÒ£¨¾ÍÔÚ±±º½ÄÇÀ¡£»·¾³Ï൱¶ñÁÓ£¬Å® ......
ºÜ¶àÅóÓÑÔÚÉîÈëµÄ½Ó´¥JavaÓïÑÔºó¾Í»á·¢ÏÖÕâÑùÁ½¸ö´Ê£º·´ÉäºÍÄÚÊ¡£¬Ö®Ç°ÎÒÃÇÒѾͨ¹ýʵÀý½âÎöÁËJavaµÄ·´Éä»úÖÆ£¬ÔÚʲô³¡ºÏÏÂÓ¦ÓÃÒÔ¼°ÈçºÎʹÓ㿽ñÌì°ÑÕâ¶þÕß·ÅÔÚÒ»Æð½éÉÜ£¬ÒòΪËüÃǶþÕßÊÇÏศÏà³ÉµÄ¡£
·´Éä
Ïà¶Ô¶øÑÔ£¬·´Éä±ÈÄÚÊ¡¸üÈÝÒ×Àí½âÒ»µã¡£ÓÃÒ»¾ä±È½Ï°×µÄ»°À´¸ÅÀ¨£¬·´Éä¾ÍÊÇÈÃÄã¿ÉÒÔͨ¹ýÃû³ÆÀ´µÃµ½¶ÔÏó(À࣬ÊôÐÔ£ ......