Çë½ÌÒ»¸öjsp¼òµ¥µÄmysqlÎÊÌâ
ÊÇÒ»Ìõ¸üвÙ×÷£º
Java code:
¡¡
private Integer bonus = 0;
public Integer getBonus() {
return bonus;
}
public void setBonus(Integer bonus) {
this.bonus = bonus;
}
String SQL = "UPDATE users SET bonus = bonus" + this.getBonus()
+ " WHERE id='" + this.getID() + "'";
new DataBase().executeUpdate(SQL);
ÔÒâÊǰÑÊý¾Ý¿âÖÐÔÓеÄbonusֵȡ³öºó¼ÓÉÏеÄthis.getBonus()ºóÔٷŻص½bonus×Ö¶ÎÖС£
¿ÉÊÇ·¢ÏÖÕâÌõsqlÓï¾äÖ´ÐÐÖ®ºóÊÇ´íÎóµÄ£º
SQL code:
SET bonus=bonus3 WHERE id='2' ¸½½üÓÐÎó
ÕæÔΣ¡£¬ÔÀ´ÊÇbonusºÍthis.getBonus()ûÓнøÐмӷ¨ÔËË㣬¶øÊÇ×Ö·ûÁ¬½ÓÔËËãÁË£¡
Ôõô¸Ä£¿£¿£¿£¿£¿£¿£¿£¿£¿
¶¥Ï£¬Ã»¿´Ã÷°×¡£
Èç¹ûÄãµÄÊý¾Ý¿âÊÇMYSQLµÄ»°
String SQL = "UPDATE users SET bonus = concat(this.getBonus(),bonus)" +
+ " WHERE id='" + this.getID() + "'";
new DataBase().executeUpdate(SQL);
Èç¹ûÉÏÃæµÄ²»ÐÐÄãÔÙÊÔÊÔÏÂÃæµÄ
String SQL = "UPDATE users SET bonus = bonus||¡±+this.getBonus
&
Ïà¹ØÎÊ´ð£º
ÔÚ²éѯºó½«²éѯ³öÀ´µÄÖµ¸³¸ø¸÷ÊäÈë¿ò
<c:if test="${not empty dataValue}">
fm.SAMPLING_DATE.value=" <c:out value='${dataValue.SAMPLING_DATE}'/ ......
×ö¸öÕ¾ÄÚËÑË÷£¬ÏÖÔÚÓÃlike ÕâÑùµÄЧÂÊʵÔÚÌ«µÍÁË£¬Ïë¸Ä³ÉÈ«ÎÄËÑË÷·½Ê½¡£
µ«¿´ÁËÍøÉÏ˵µÄÖÐÎÄÖ§³Ö²»ºÃ£¬ÏëÎÊһϸ÷λÐÖµÜÊÇÈçºÎ½â¾öÕâ¸öÎÊÌâµÄ£¿
µ¥¶À½¨Á¢Ö÷Ìâ±íºÍÄÚÈÝ±í ¼ìË÷Ö÷Ìâ
È»ºó¸ù¾ÝÖ÷Ìâ¼ìË÷Ä ......
<%@ page contentType = "text/html;charset =gb2312"%>
<%!
public String codeToString(String str)
{
String s =str;
&nbs ......
SetGetPropertytest.jspÔ´´úÂëÈçÏ£¬Ð»Ð»´ó¼ÒǰÀ´°ï棬ͬʱף´ó¼ÒÖÐÇï¿ìÀÖ
<%@ page c%>
<HTML>
<HEAD>
<TITLE>setProperty¶¯×÷ÓëgetProperty¶¯×÷·¶Àý </TITLE> ......
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......