binding exception invalid bound statement not found
时间: 2023-08-26 16:19:04 浏览: 86
这是一个错误信息,通常发生在使用 MyBatis 进行数据库操作时。它表示 MyBatis 找不到指定的 SQL 语句,可能是因为 SQL 语句的 id 错误或者在配置文件中没有定义对应的 SQL 语句。解决方法是检查你的 Mapper 文件中的 SQL 语句的 id 是否正确,并且确保在配置文件中正确地配置了 Mapper 文件。如果还有问题,可以提供更多的细节信息,我可以帮你更好地解决问题。
相关问题
catch exception:Invalid bound statement (not found)
当出现"Invalid bound statement (not found)"异常时,通常是因为代码中的statement和SQL语句不匹配导致的。具体地说,这个异常可能是由于statement写错了,无法在映射文件中找到对应的SQL语句所致。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Invalid bound statement (not found)](https://blog.csdn.net/keyboard_/article/details/127830039)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):](https://blog.csdn.net/m0_57878685/article/details/118222229)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)这个异常通常出现在MyBatis中,它表示在映射文件中找不到有效的绑定语句。通过查看引用和引用的内容可以发现,这个异常通常是由于参数没有正确传递导致的。在引用中,异常信息显示Parameter 'userI' not found,而在引用中,异常信息显示Parameter 'levelName' not found。这说明在映射文件中,没有找到与传入参数名匹配的语句。可能的解决方法是检查映射文件中的语句,确保参数名与传入的参数名一致,并且确保语句的正确性。另外,还可以检查Mapper接口方法的参数是否正确命名。如果仍然无法解决问题,可以考虑使用Maven Compiler插件来重新编译项目。<span class="em">1</span><span class="em">2</span><span class="em">3</span>