your MySQL server version for the right syntax to use near 'COMMAND='??''
照着视频拔下来的代码,怎么就提示这里错了呢
StringBuilder sql = new StringBuilder("select ID,COMMAND,DESCRIPTION,CONTENT from message where 1=1");
List<String> paramList = new ArrayList<String>();
if(command!=null && !"".equals(command.trim())){
sql.append("and `COMMAND`=?");
paramList.add(command);
}
if(description!=null && !"".equals(description.trim())){
sql.append("and DESCRIPTION like '%' ? '%'");
paramList.add(description);
}
PreparedStatement statement = conn.prepareStatement(sql.toString());