单引号不能直接用于字符串中
上边的sql字符串改为:
sql="delete from user_ngq where name=\'123\'";
就可以了

解决方案 »

  1.   

    单引号不能直接用于字符串中?
    可以的吧!
    说不准是name是某个数据库保留字引起了冲突吧!
      

  2.   

    String sql="delete from user_ngq where name='123'";
    改成: String id="123";
      String sql="delete from user_ngq where name="+id;
    试一下我以前也遇到这样的情况!
      

  3.   

    单引号可以用在字符串你把执行数据库的注释掉,然后把sql打印出来直接到库里执行看看是什么结果就知道问题所在了!
      

  4.   


     use the sentence :string sql="delete from user_ngq where name='123'";
    I think is right!
      

  5.   

    赞成jswall的改法,更赞成jishuo的调试方法!