若是出現相似這樣的錯誤,檢查一下是否sql語句和參數的位置對調了。java
java.lang.RuntimeException: java.sql.SQLException: Too many parameters: expected 0, was given 1 Query: 1 Parameters: [SELECT COUNT(*) FROM book WHERE category_id=?]