當前位置:首頁 » 編程語言 » ibatissqlnotin

ibatissqlnotin

發布時間: 2025-01-22 14:42:25

Ⅰ Ibatis裡面用in寫sql語句,問什麼報下面的錯

ibatis sql in 操作(iterate屬性)

1、使用iterate屬性,status為數組。

<isNotNull property="status">
<![CDATA[ status in ]]>
<iterate property="status" conjunction="," open="(" close=")">
#status[]#
</iterate>
</isNotNull>

2、使用$,但這種寫法存在一定的風險,可能會引起sql注入。

SELECT * FROM test WHERE status in ($status$);

熱點內容
編程器解讀 發布:2025-07-03 03:22:49 瀏覽:23
中國電信加密通信業務 發布:2025-07-03 03:06:00 瀏覽:520
腳本家的台詞 發布:2025-07-03 03:05:50 瀏覽:708
arcgisforpython 發布:2025-07-03 03:05:46 瀏覽:898
期計演算法 發布:2025-07-03 02:56:53 瀏覽:404
不同域訪問 發布:2025-07-03 02:49:05 瀏覽:818
多槽編程 發布:2025-07-03 02:47:42 瀏覽:919
sql2008錯誤233 發布:2025-07-03 02:28:52 瀏覽:168
創建資料庫語句mysql 發布:2025-07-03 02:14:34 瀏覽:146
python量化投資 發布:2025-07-03 02:05:11 瀏覽:804