java ÇóÖú - Java / Java EE
insert into [ScholarshipManagement].[dbo].[department] ([department],[specialization] ,[grade]) output inserted.departmentID values(? ,? ,? )
ÇëÎÊ´ó¸çÃÇÕâ¸ösql Óï¾äÓ¦¸ÃÓÃJavaÀïµÄÄǸöÊý¾Ý¿â²Ù×÷·½·¨£¿Ëü²åÈëÊý¾ÝÈ»ºó·µ»ØÁ˲åÈëÊý¾ÝµÄÖ÷¼üdepartmentID
ÓõÄSql server 2005
execute
ER¡£¡£¡£¡£¡£¡£LZ£¬ÖªµÀJDBCÊÇÕ§Ò»¸ö¶«Î÷µÄ²»£¿£¿
Óᾡ¿ÎÒûд¹ýѽ¡£¡£¡£¶¥Ï ÆÚ´ýÖС£¡£¡£
HQL ÓÃsave
×øµÈ¸ßÈËפÔú8319449 JAVA¼¼Êõ¸ß¼¶½»Á÷Ⱥ¡£¡£¡£
jdbcÖªµÀ°¡£¬¾ÍÓõÄËü£¬¿ÉÊÇËƺõûÓкÏÊʵķ½·¨Õâ¸öÓï¾äÓиöÊä³öoutput inserted.departmentID
first ask good master
getGeneratedKeys()
Ïà¹ØÎÊ´ð£º
µ±ÖªµÀÒ»¸öÈÕÆÚ£¬ÈçºÎ°ÑÕâ¸öÈÕÆÚËùÔÚÑ®µÄÇ°ºóÁ½¸öÈÕÆÚÈ¡³ö
±ÈÈçÊäÈë20090905£¬¾ÍÊäÈë20090901 20090910
Êä³ö20090901 20090910
È¡µÃÌìÊýºó×÷Ò»ÏÂÅжÏÔÙ°ÑÕâ¸ö·½·¨ÓÃÏÂvoid set(int field, int value)
......
¸÷·´óÏÀ¸ø¸ö˼·£¬²»ÊÇÔÚÏßµÄÄÇÖÖ£¬¾ÍÊÇÒ»¸ö×öÆÕͨµÄÓ¦ÓóÌÐò¡£
´Ê¿âÔõôÉú³ÉÄØ£¿
²»»á¡£
ÒýÓÃ
´Ê¿âÔõôÉú³ÉÄØ£¿
ÕÒ±¾×Öµä
ÒýÓÃ
´Ê¿âÔõôÉú³ÉÄØ£¿
Êý¾Ý¿â ºÇºÇ
ÓÃmap ¼üÖµ¶ÔÓ¦
Èç¹ûÓÃÊý¾Ý¿ ......
ÌâÄ¿£º
ÓÐ1,2,3£¬4,5,6Áù¸öÊý×ÖÅÅÐò£¬ÓÃjava³ÌÐò¼ÆËã³öÅÅÐòµÄÖÖÀà¡£
ÒªÇó£ºÒ»£¬ÒÔ4¿ªÍ·
¶þ£¬2,3²»ÄÜÏàÁÚ
Èý£¬²»ÄÜÒÔ5¿ªÍ·
Ï£Íû´ó¼ÒÄܼ´ ......
×î½üÒ»¸öÏîÄ¿ÖÐÓöµ½Ò»¸öÎÊÌ⣺ÔÚÔÓеÄÒ»Ì×ϵͳÖÐ(php¿ª·¢)Ìí¼ÓһЩС¹¦ÄÜ(jsp¿ª·¢)£¬ÔÀ´Óû§ÏµÍ³¶¼ÊÇphp¿ª·¢µÄ£¬ÎÒÈçºÎÔÚjsp¿ª·¢µÄ¹¦ÄÜÖÐ×öµ½Óû§ÐÅÏ¢sessionͬ²½ÄØ£¿ ÓÐÈËÊÇ·ñÓÐ×ö¹ýÀàÒÔÏîÄ¿£¬ÏëÌýÌý´ó¼ÒµÄ¿´·¨
......
È磺 @superwaring("unchecked");
Õâ¸öÀïÃ涼¿ÉÒÔÈ¡ÄÄЩֵ°¡£¬»¹ÓÐÀàËÆµÄ @superwaring±êÇ©ÓÐÄÄЩ°¡
ûÓùý¡£¡£
¿´jeeµÄapi
javax.persistenceÀï
@superwaring("unchecked");Ö»ÊǺöÂÔ ......