这个sql语句在别的地方是没有异常的,可是在这里提示语句错误: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
这个sql语句在别的地方是没有异常的,可是在这里提示语句错误: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
你可以把SQL变量打印出来看看,应该是tfid.getText()返回的是空字符串,也就是控件里面没有值;控件返回合法的值就不会报错,空值就会报错,你可以加一个if语句判断一下
if(tfid.getText() !=null && !tfid.getText().equals("")){
//这里生成SQL语句肯定就不会报错了。
}