append的问题

Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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

 

sb.append("select * from imooc_goddess");
        sb.append("where user_name =?");

报错

加个空格就解决了

sb.append(" select * from imooc_goddess ");
        sb.append(" where user_name =? ");

 

posted on 2016-10-30 15:27  黑底白纹  阅读(131)  评论(0编辑  收藏  举报

导航