根據搜索框里輸入的內容到后臺資料庫進行模糊查詢該怎么寫
在title 和sub_title這兩個欄位進行模糊查詢
大神幫幫忙幫寫一下
uj5u.com熱心網友回復:
我自己頂一下uj5u.com熱心網友回復:
難道不是直接使用like關鍵字對欄位內容執行模糊查詢嘛?有什么其他的技術要求難點嘛
uj5u.com熱心網友回復:
select * from tableName Where title like '%查詢內容%' or sub_title like '%查詢內容%'uj5u.com熱心網友回復:
有了SQL陳述句了,但是搜索框輸入內容后臺接受過來報錯Field error in object 'testpojo' on field 'id': rejected value [成功]; codes [typeMismatch.testpojo.id,typeMismatch.id,typeMismatch.int,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [testpojo.id,id]; arguments []; default message [id]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'id'; nested exception is java.lang.NumberFormatException: For input string: "成功"]]轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/226656.html
標籤:Java相關
下一篇:JAVA中的錯誤
