我的源码为
String sql="select * from custom_sm where data like "\"%"+currDate+"%\"";
我觉得我源码没问题,因为我在UNIX下,用过类似代码。

解决方案 »

  1.   

    内部 sql 转意  用 '\\'  试试!!!
      

  2.   

    sql="select * from custom_sm where data like "\"%"+currDate+"%\""在SQL中怎么不用'而用"?
      

  3.   

    sql用'来,建议不要用"
    String sql="select * from custom_sm where date like '%"+currDate+"%'";
    如果sql中有要用到'的用''
    String sql="select * from table01 where date like '%''%';
      

  4.   

    "select * from custom_sm where data like "\"%"+currDate+"%\""
    SQL语句应该用单引号
    如果要用双引号的话我想应该也是:
    "select * from custom_sm where data like \"%"+currDate+"%\""
    去掉反斜线前的那个双引号
      

  5.   

    对,对,(申),我写错了,我是用
    String sql="select * from custom_sm where data like \"%"+currDate+"%\""
    我知道可用'',但我这样用转义字符也没错呀,以前我也这样用过,况且我在其它地方也要用转义字符,也不成功,不知道是否还有其它转义字符替代它。