java viewjdbc使用in操作

在前端拼接数据,直接在sql中使用 in ( + ids +)拼接字符串。

int update = ViewJDBC.update("update question set qview=? where qno in("+qnos+")",qview);
if(update>0){
    return Message.success("权限修改成功");
}else{
    return Message.fail("服务器繁忙,请稍后试试");
}

这里字符串的 in 不能使用 ? 代替,否则会导致错误。

成功或失败, 返回影响结果的条数。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注