数据库问题 可否大神帮我看看

施立 发布于 2016/12/06 20:18
阅读 274
收藏 0

云原生2.0展望丨从“小众”到“首选”,推动云原生产业落地华为云作用几何?>>>

@JFinal 你好,想跟你请教个问题:

使用

Db.update("update web_attachments set in_use = 1 where id in (?)", "59,56,57,58");

语句发现只有一行数据被更新, 日志如下

Sql: update web_attachments set in_use = 1 where id in (?)
[http-bio-8080-exec-8] DEBUG druid.sql.Statement - {conn-10010, pstmt-20069} created. 
update web_attachments set in_use = 1 where id in (?)
[http-bio-8080-exec-8] DEBUG druid.sql.Statement - {conn-10010, pstmt-20069} Parameters : [59,56,57,58]
[http-bio-8080-exec-8] DEBUG druid.sql.Statement - {conn-10010, pstmt-20069} Types : [VARCHAR]
[http-bio-8080-exec-8] DEBUG druid.sql.Statement - {conn-10010, pstmt-20069} update executed. effort 1. 4.091216 millis. 
update web_attachments set in_use = 1 where id in (?)
[http-bio-8080-exec-8] DEBUG druid.sql.Statement - {conn-10010, pstmt-20069} closed
[http-bio-8080-exec-8] DEBUG druid.sql.Connection - {conn-10010} commited
[http-bio-8080-exec-8] DEBUG druid.sql.Connection - {conn-10010} setAutoCommit true
[http-bio-8080-exec-8] DEBUG druid.sql.Connection - {conn-10010} pool-recycle

数据库截图

加载中
0
Weeki666
Weeki666
Db.update("update web_attachments set in_use = 1 where id in (?)", "59,56,57,58");

"59,56,57,58"  这是字符串,为什么不是数组呢?


施立
施立
我试试数组 是不是可以!
0
爱生活_爱JAVA
爱生活_爱JAVA
in 的方式需要使用多个?,如: abc in (?,?,?,?)
返回顶部
顶部