DataSource ds = null; Context initctx=new InitialContext(); ds=(DataSource)initctx.lookup("java:OracleDS"); if(ds!=null){ Connection conn=ds.getConnection(); Statement st = null; conn.setAutoCommit(false); st=conn.createStatement(); int i=20; try{ while(i>0){ st.executeUpdate("update WS_TEMPLATE set top=0 where dataitem_id=4 and style_id=1"); i--; } }catch(Exception ex){ try{ conn.rollback(); }catch(Exception ex1){} }finally{ st.close(); conn.close(); } }
Èç¹û°ÑupdateÓï¾ä»»³Éupdate WS_TEMPLATE set top=0 where dataitem_id=4¾Í¿ÉÒÔͨ¹ý£¬ÇëÎÊÊÇÔõô»ØÊ£¿1: ͬÑùµÄÓï¾äÖ´ÐÐ20´Î²»ÖªµÀÊǸÉʲô£¿ 2: ÄãÕâ¸öÈç¹û²úÉúËÀËøµÄ»°£¬¿ÉÄÜÊǺÍÆäËüµØ·½³åÍ»£¬±¾ÉíÓ¦¸Ã²»»áÓÐÎÊÌ⣬ÁíÍâÒ»¸öµØ·½¿ÉÄÜÒ²ÔÚ¸üÐÂWS_TEMPLATE±í£¬ÒòΪÄãÕâ¸öµØ·½Á¬Ðø¸üÐÂ20´Î£¬Èç¹ûÔÚÕâ20´ÎÖмäÓÐÆäËüµØ·½¶ÔÕâ¸ö¼Ç¼½øÐиüоͿÉÄÜ»á²úÉúËÀËø¡£ style_idÊÇÍâ¼ü°É?Èç¹ûÊǵĻ°£¬¸østyle_id¼ÓindexÓ¦¸Ã¿ÉÒÔ½â¾ö¡£
²»ÖªµÀÊÇʲôÔÒò£¬ÎÒ¸ÃÈçºÎ´¦Àí£¬Çë´óϺÃÇÖ¸½ÌÁË£¬Ð¡µÜÔÚ´Ëл¹ý¡£¡£¡£¡£ ´íÎóÐÅÏ¢ÈçÏ£º The program being debugged was signaled while in a function called from GDB. GDB has restored the context t ......
1.int x xËãÊǶÔÏóô£¿ÎªÊ²Ã´£¿ 2.Ϊʲô·½·¨ÖеıäÁ¿µÄ¸³Öµ£¬static·½·¨²»ÄÜÉùÃ÷static±äÁ¿£»ÎªÊ²Ã´£¿ 3.StringÒ²ÊÇÒ»¸öÀàΪʲôÔÚ´«µÝString²ÎÊý¸ø·½·¨µÄʱºò²»¸Ä±äʵ²ÎµÄÖµ£» 4.ÓÃstatic { type à ......