问题描述
代码
if(ae.getSource()== bpaid)
{
int k;
rs = pst.executeQuery();
字符串状态= tfees.getText();
系统.out.println(status);
String ss =update fees set feesstatus =+ status +where fees.sid =+ roll +;
k = st.executeUpdate(ss);
if(k> 0)
{
System.out .println(记录已更新);
}
状态是已支付的费用状态/没有。
code
if (ae.getSource() == bpaid)
{
int k;
rs = pst.executeQuery();
String status = tfees.getText();
System.out.println(status);
String ss = "update fees set feesstatus= " + status + " where fees.sid=" + roll + "";
k = st.executeUpdate(ss);
if (k>0)
{
System.out.println("Record Is Updated");
}
status is the fees status paid / unpaid.
推荐答案
String ss = "update fees set feesstatus= " + status + " where fees.sid=" + roll + ";
更改为
change to
String ss = "update fees set feesstatus= " + status + " where fees.sid=" + roll;
注意:在代码中使用空格并不是不好的做法,它使它更具可读性,更容易找到这种错误。
我重新格式化你的代码,并立即看到额外的字符。
Note: Using spaces in your code is not bad practice, it makes it more readable and it is easier to find this kind of errors.
I re-formatted your code and saw the extra character in an instant.
这篇关于请帮助错误::: null指针异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!