首页 > 代码库 > append的问题

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 =? ");

 

append的问题