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 'description like '%''erer''%'' at line 1 怎么拼接的时候会出现这个错呢
SELECT ID,COMMAND,DESCRIPTION,CONTENT FROM message WHERE 1=1 AND DESCRIPTION LIKE '%' ? '%';
sql.append(" and DESCRIPTION like '%' ? '%'");
正确拼接
我也是这个问题 你怎么解决的